Write a program that asks the user to enter todays sales rou

Write a program that asks the user to enter today\'s sales rounded to the nearest $100 for each of three 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. User input is shown in bold. Enter today\'s sales for store 1: 1000[Enter] Enter today\'s sales for store 2: 1200[Enter] Enter today\'s sales for store 3: 900[Enter] DAILY SALES (each * = $100) Store 1: Store 2: Store 3:

Solution

#include <cstdlib>
#include <iostream>
using namespace std;

int main()
{
int s1,s2,s3,ast1,ast2,ast3,store;

cout << \"Enter today\'s sale for store 1:\";
cin >> s1;
cout << \"Enter today\'s sale for store 2:\";
cin >> s2;
cout << \"Enter today\'s sale for store 3:\";
cin >> s3;

cout << \"DAILY SALES\" <<endl;
cout << \"each * = $100\"<<endl;

ast1 = s1/100;
ast2=s2/100;
ast3=s3/100;
  
cout << \"Store 1:\";

for (int i= 1; i<= ast1; i++)
{
  
cout << \"*\";
}
cout <<endl;
cout << \"Store 2:\";

for (int i= 1; i<= ast2; i++)
{
  
cout << \"*\";
}
cout <<endl;
cout << \"Store 3:\";

for (int i= 1; i<= ast3; i++)
{
  
cout << \"*\";
}
cout<<endl;
return 0;
}

 Write a program that asks the user to enter today\'s sales rounded to the nearest $100 for each of three stores. The program should then display a bar graph co

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site