Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Hector Villalobos
- import java.util.Scanner;
- public class Challenge12BarChart {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- String barChart = "SALES BAR CHART\n";
- for(int i = 1; i <=5; i++) {
- System.out.print("Enter today's sales for store " + i + ": ");
- int sales = keyboard.nextInt();
- barChart += "Store " + i + ": ";
- for(int j = 100; j <= sales; j += 100) {
- barChart += "*";
- }
- barChart += "\n";
- }
- System.out.println(barChart);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment