Question: Modify the code to use functions. Create a getInput function, a calcTotal function and a displayResults function. The purpose of getInput is to prompt the

Modify the code to use functions. Create a getInput function, a calcTotal function and a displayResults function. The purpose of getInput is to prompt the user for input and assign values to the 2D array. The purpose of the caclTotal function is to process the 2D Array and accumulate the total sales. The purpose of the displayResults functionn is to display the entire 2D array for quarterly sales as well as the total sales. The main function should consist of variable declarations and function calls. Do not use global variables. Pass the data through functions parameters or value returning functions. Please help. Answer in C++ please.

Modify the code to use functions. Create a getInput function, a calcTotal

2 #include 3 #include 4 using namespace std; 6 int main() const int NUM_DIVS 3 const int NUM QTRS 4 double sales[NUM-DIVS?NUM-QTRS); // Array with 3 rows and 4 columns. double totalSales- int div, qtr; // Number of divisions // Number of quarters // To hold the total sales. // Loop counters. 13 14 cout > sales[div][qtr]; 28 cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!