daily pastebin goal
77%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cout << "Histograms:" << endl << endl;
  2.    
  3.     for (count = 0; count < numChoices; count ++)
  4.     {
  5.         cout << count + 1 << ": ";
  6.        
  7.         percentage = (survey[count] / (double) total) * 100;
  8.         even = (int)(percentage + 0.5) / 2;
  9.        
  10.         if (even > 0)
  11.         {
  12.             for (stars = 0; stars < even; stars ++)
  13.             {
  14.                 cout << "*";
  15.             }
  16.         }
  17.  
  18.         if ((int)(percentage + 0.5) % 2)
  19.         {
  20.             cout << "+";
  21.         }
  22.         cout << endl;
  23.        
  24.     }
  25.  
  26.     cout << endl;
  27.     cout << "* = 2%, + = 1%" << endl;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top