7.10 - endl; cout << "...

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

View Full Document Right Arrow Icon
#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]<<
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

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

Page1 / 2

7.10 - endl; cout &amp;amp;lt;&amp;amp;lt; &amp;amp;quot;...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online