-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPinito.java
More file actions
47 lines (39 loc) · 1.04 KB
/
Copy pathPinito.java
File metadata and controls
47 lines (39 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.softtek.java.academy.excersices;
import java.util.Scanner;
//HACER ESTE EJERCICIO CON UN LOOP.
public class Pinito {
String puntito;
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("how many rows to print out (1-10)?");
int number = scanner.nextInt();
if (number < 10) {
switch (number) {
case 10:
System.out.println("**********");
case 9:
System.out.println("*********");
case 8:
System.out.println("********");
case 7:
System.out.println("*******");
case 6:
System.out.println("******");
case 5:
System.out.println("*****");
case 4:
System.out.println("****");
case 3:
System.out.println("***");
case 2:
System.out.println("**");
case 1:
System.out.println("*");
default:
System.out.println("There's not more points.");
}
} else if (number < 0 || number > 10) {
System.out.println("The number of rows is out of the rage (1-10).");
}
}
}