# 7.10 - endl cout<<" Number of employees in the...

This preview shows pages 1–2. Sign up to view the full content.

#include <iostream> #include <string> # using namespace std; u int main() { bool flag = true; string answer; int counters[9]={0,0,0,0,0,0,0,0,0}; int sales; int commission; int index; i while ( flag){ w cout << "Enter employee's sales" << endl; cin >> sales; commission = 0.09*sales; index = commission/100; i if (index < 9) counters[index]++; else counters[8]++; c cout << endl << endl << " More employees? (yes/no)" << endl; cin >> answer; if (answer == "no") flag = false; cout << endl << endl; c } cout << " Number of employees in the \$200-299 range is; " << counters[0]<< endl; cout << " Number of employees in the \$300-399 range is; " << counters[1]<< endl; cout << " Number of employees in the \$400-499 range is; " << counters[2]<<

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: endl; cout << " Number of employees in the \$500-599 range is; " << counters[3]<< endl; cout << " Number of employees in the \$600-699 range is; " << counters[4]<< endl; cout << " Number of employees in the \$700-799 range is; " << counters[5]<< endl; cout << " Number of employees in the \$800-899 range is; " << counters[6]<< endl; cout << " Number of employees in the \$900-999 range is; " << counters[7]<< endl; cout << " Number of employees in the \$1000+ range is; " << counters[8]<< endl; e cout << "Enter 0 to exit"; int exit; cin >> exit; c return 0; }...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

7.10 - endl cout<<" Number of employees in the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online