-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbarChartPrintingProgram.java
More file actions
38 lines (34 loc) · 1.12 KB
/
barChartPrintingProgram.java
File metadata and controls
38 lines (34 loc) · 1.12 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
package Practice.Assignments;
import java.util.*;
import java.lang.*;
public class barChartPrintingProgram {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter number within the range of 1 and 30: ");
int number1 = input.nextInt();
int number2 = input.nextInt();
int number3 = input.nextInt();
int number4 = input.nextInt();
int number5 = input.nextInt();
for (int count = 1; count <= number1; count++){
System.out.print("* ");
}
System.out.println();
for (int count = 1; count <= number2; count++) {
System.out.print("* ");
}
System.out.println();
for (int count = 1; count <= number3; count++) {
System.out.print("* ");
}
System.out.println();
for (int count = 1; count <= number4; count++) {
System.out.print("* ");
}
System.out.println();
for (int count = 1; count <= number5; count++) {
System.out.print("* ");
}
System.out.println();
}
}