Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that asks the user to enter today\'s sales rounded to the neares

ID: 3791058 • Letter: W

Question

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:

Explanation / Answer

#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;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote