fork download
  1. //OrinTill Qimid CS1A Chapter 4, P. 294, 10
  2. //
  3. /**************************************************************
  4.  * Compute sales bar
  5.  *
  6.  * ____________________________________________________________
  7.  * This program will calculate the sales for 5 stores
  8.  * ____________________________________________________________
  9.  * INPUT
  10.  * array : the number of sale for each store.
  11.  * OUTPUT
  12.  * the bar graph that represent each store sale.
  13.  **************************************************************/
  14. #include <iostream>
  15. #include <iomanip>
  16. #include <cmath>
  17. using namespace std;
  18.  
  19. int main()
  20. {
  21. float array[5];
  22. float Star;
  23. for (int q = 0; q <5; q++)
  24. {
  25. cout<<"whats your sale for store "<<q+1<<endl;
  26. cin>> array[q];
  27. }
  28.  
  29.  
  30. for (int store = 0; store<5; store++)
  31. {
  32. cout << "Store "<< store +1<< ": ";
  33. Star = array[store]/100;
  34. for ( int i= 0; i < Star; i++)
  35. {
  36. cout<<"*";
  37. }
  38. cout<<endl;
  39. }
  40. return 0;
  41. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Standard output is empty