Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args){
- Scanner scanner = new Scanner(System.in);
- int store1, store2, store3,
- store4, store5;
- System.out.print("Enter today's sales for store 1: ");
- store1 = scanner.nextInt();
- System.out.print("Enter today's sales for store 2: ");
- store2 = scanner.nextInt();
- System.out.print("Enter today's sales for store 3: ");
- store3 = scanner.nextInt();
- System.out.print("Enter today's sales for store 4: ");
- store4 = scanner.nextInt();
- System.out.print("Enter today's sales for store 5: ");
- store5 = scanner.nextInt();
- System.out.println("SALES BAR CHART");
- System.out.print("Store 1: ");
- for (int i = 0; i < store1; i += 100)
- {
- System.out.print("*");
- }
- System.out.println(" ");
- System.out.print("Store 2: ");
- for (int i = 0; i < store2; i += 100)
- {
- System.out.print("*");
- }
- System.out.println(" ");
- System.out.print("Store 3: ");
- for (int i = 0; i < store3; i += 100)
- {
- System.out.print("*");
- }
- System.out.println(" ");
- System.out.print("Store 4: ");
- for (int i = 0; i < store4; i += 100)
- {
- System.out.print("*");
- }
- System.out.println(" ");
- System.out.print("Store 5: ");
- for (int i = 0; i < store5; i += 100)
- {
- System.out.print("*");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment