1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
Salesperson Jan. Feb. March
1 2400 3500 2000
2 1500 7000 1000
3 600 450 2100
4 790 240 500
5 1000 1000 1000
6 6300 7000 8000
7 1300 450 700
8 2700 5500 6000
9 4700 4800 4900
10 1200 1300 400
//Advanced25 Ch. 12
//Displays the bonus corresponding to the total sales of
//each salesperson
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
//declare array and variables
int salesAmounts[10][4] = {{1, 2400, 3500, 2000},
{2, 1500, 7000, 1000},
{3, 600, 450, 2100},
{4, 790, 240, 500},
{5, 1000, 1000, 1000},
{6, 6300, 7000, 8000},
{7, 1300, 450, 700},
{8, 2700, 5500, 6000},
{9, 4700, 4800, 4900},
{10, 1200, 1300, 400}};
for (int salesPerson = 0; salesPerson < 10; salesPerson ++)
{
for (int month = 0; month < 4; month ++)
cout << " " << salesAmounts[salesPerson][month];
cout << endl << endl;
}
return 0;
} //end of main
|