Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cout << "Histograms:" << endl << endl;
- for (count = 0; count < numChoices; count ++)
- {
- cout << count + 1 << ": ";
- percentage = (survey[count] / (double) total) * 100;
- even = (int)(percentage + 0.5) / 2;
- if (even > 0)
- {
- for (stars = 0; stars < even; stars ++)
- {
- cout << "*";
- }
- }
- if ((int)(percentage + 0.5) % 2)
- {
- cout << "+";
- }
- cout << endl;
- }
- cout << endl;
- cout << "* = 2%, + = 1%" << endl;
Add Comment
Please, Sign In to add comment