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
|
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
const int COLS = 6;
const int ROWS = 5;
double getTotal(int[][COLS]);
double getAverage(int[][COLS]);
double getRowTotal(int[][COLS], int);
double getColumnTotal(int[][COLS], int);
double getHighest(int[][COLS], int&, int&);
double getLowest(int[][COLS], int&, int&);
int main()
{
string division[ROWS] = { "North", "South", "East", "West", "Quarter Total" };
string quarter[COLS] = {"", "Quarter 1", "Quarter 2", "Quarter 3", "Quarter 4", "Division Total"};
int count, div, qtr;
int sales;
for (div = 0; div < ROWS; div++)
{
for (qtr = 0; qtr < COLS; qtr++)
{
cout << "What is the sales amount for " << division[ROWS] << "division, "
<< quarter[COLS] << "?" << endl;
cin >> sales[div][qtr];
}
while (sales[div][qtr] < 0)
{
cout << "You entered an invalid number please enter a value greater than 0." << endl;
cin >> sales[div][qtr];
}
}
return 0;
}
|