// Torrez, Elaine CS1A Chapter 4, P. 232, #6
/*******************************************************************************************
*
* SALES BAR CHART
* ________________________________________________________________________________________
* This program asks the user to enter today’s sales for five stores.
* The program then displays a bar graph comparing each store’s sales.
* Each bar in the graph is made up of asterisks (*), where each asterisk
* represents $100 in sales.
* ________________________________________________________________________________________
*
* INPUT:
* store1, store2, store3, store4, store5 : Sales for each store
*
* OUTPUT:
* Bar chart made of asterisks representing $100 increments of sales
*
*******************************************************************************************/
#include <iostream>
using namespace std;
int main()
{
/***** VARIABLE DECLARATIONS *****/
int store1; // Sales for store 1
int store2; // Sales for store 2
int store3; // Sales for store 3
int store4; // Sales for store 4
int store5; // Sales for store 5
/***** INPUT SECTION *****/
cout << "Enter today's sales for store 1: ";
cin >> store1;
cout << "Enter today's sales for store 2: ";
cin >> store2;
cout << "Enter today's sales for store 3: ";
cin >> store3;
cout << "Enter today's sales for store 4: ";
cin >> store4;
cout << "Enter today's sales for store 5: ";
cin >> store5;
/***** OUTPUT SECTION *****/
cout << endl;
cout << "SALES BAR CHART" << endl;
cout << "(Each * = $100)" << endl;
// Store 1
cout << "Store 1: ";
for (int i = 0; i < store1 / 100; i++)
cout << "*";
cout << endl;
// Store 2
cout << "Store 2: ";
for (int i = 0; i < store2 / 100; i++)
cout << "*";
cout << endl;
// Store 3
cout << "Store 3: ";
for (int i = 0; i < store3 / 100; i++)
cout << "*";
cout << endl;
// Store 4
cout << "Store 4: ";
for (int i = 0; i < store4 / 100; i++)
cout << "*";
cout << endl;
// Store 5
cout << "Store 5: ";
for (int i = 0; i < store5 / 100; i++)
cout << "*";
cout << endl;
return 0;
}