//Jacklyn Isordia CSC5 Chapter 5, P. 297, #17
//
/**************************************************************
*
* CALCULATES DAILY SALES FROM 5 STORES
* ____________________________________________________________
* This program collects daily sales figures for five stores
* and displays a bar chart where each asterisk (*) represents
* $100 in sales.
* ____________________________________________________________
* INPUT
* sales[5] : An array of five integers representing
* daily sales for each store.
* OUTPUT
* A bar chart comparing store sales using asterisks.
* Formula
* numAsterisks = sales / 100
*
**************************************************************/
#include <iostream>
using namespace std;
int main() {
int sales[5];
for (int i = 0; i < 5; i++) {
cout << "Enter today's sales for store" << (i + 1) << ": ";
cin >> sales[i];
}
cout << "\nSALES BAR CHART" << endl;
cout << "(Each * = $100)" << endl;
for (int i = 0; i < 5; i++) {
cout << "Store" << (i + 1) << ": ";
int numAsterisks = sales[i] / 100;
for (int j = 0; j < numAsterisks; j++) {
cout << "*";
}
cout << endl;
}
return 0;
}