Write a program that asks the user to enter today's sales for five stores. The program should then display a bar graph comparing each store's sales. Create each bar in the graph by displaying a row of asterisks. Each asterisk should represent $100 of sales.
Here is an example of the program's output:
Enter today's sale for store 1: 1000 (enter)
Enter today's sale for store 2: 1200 (enter)
Enter today's sale for store 3: 1800 (enter)
Enter today's sale for store 4: 800 (enter)
Enter today's sale for store 5: 1900 (enter)
SALES BAR CHART
(Each * = $100)
Store 1: **********
Store 2: ************
Store 3: ******************
Store 4: ********
Store 5: *******************
My Current Code:
#include <iostream>
using namespace std;
int main()
{
int stores;
int i = 1;//counter variables
int sale;
int j = 1;//counter variables
// Get input from the user to see how many stores you are listing
cout << "Please enter how many stores you are inputting data for.\n";
cin >> stores;
while(j<= stores)
{
cout << "Enter today's sale for store "<< i << ": ";
cin >> sale;
j++;
i++;
}
cout << "SALES BAR CHART:" << endl;
cout << "Each * = $100" << endl;
}
Note: Only allowed to use if/else statements as well as loops.