company's sales data The company has three divisions. The program uses a 2-D array of three rows and four columns. Each column represents one quarter of the year. Each row represents the sales data of one division The program consists of a main function and another function for displaying a 2-D array passed in through arguments The program has defined a global constant to represent the number 4 as the four quarters of an year. Use this constant identifier wherever the number 4 is required as the four quarters of an year. Write the prototype for the function named printSalesData above the main function. The function receives a 2-D array as the first argument and the number of divisions as the second argument. It returns void. The main function has a 2-D array defined and initialized. It then reads the data from user to fill the array. You need to supply the data in the input area. Complete the call statement that calls printSalesData function with the appropriate arguments to print the report Below the main function, write the definition of printSalseData Test The Program In Develop Mode, copy the following three lines to the box below the line that says "Enter program input (optional) 201.24 312.43 271.83 150.91 270.83 421.51 422.14 251.85 732.53 321.67 641.69 321.55 and then press the "Run program" button. Here is the expected output. Corporation Sales Report 01 Q2 201.24 312.43 271.83 DIV 0 1 2 150.91 422.14 321.55 03 270.83 251,85 321.67 04 421.51 732.53 641.69. If you see the expected output, you may then select the "Submit mode and press the "Submit for grading" button. Look at the results and see if your solution has passed all tests.
14 #include 15 #include 16 17 using namespace std; 18 19 const int QUARTERS = 4; 20 21 // Write the prototype of printSalesData here.I 22 void printSalesData(double salesData[3] [QUARTERS]); 23 24 int main(int argc, const char argv[]) { double salesData [3][QUARTERS] (0); 25 26 27. 28 29 30 31 32 $&55‡**** 43 33 34 35} 36 37 // Write the definition of printSalesData here. 38 39 ( 40 41 42 44 for (int div 8; div < 3; ++div) { for (int qtr 8; qtr cin>> salesData[div][qtr]: } 45 46 47 48 49 QUARTERS; ++qtr) { // Complete the call statement below. printSalesData(salesData); return 0; void printSalesData(double salesData[3][QUARTERS]) cout <<"Corporation Sales Report"<< endl; cout << DIV" <> salesData[div][qtr]; return 0; // Complete the call statement below. printSalesData(salesData); // Write the definition of printSalesData here. void printSalesData(double salesData[3][QUARTERS]) cout <<"Corporation Sales Report" << endl; cout <<" DIV" <
Complete the program from the template to prints the contents of a 2-D array which contains Complete the program from the template to prints the contents of a 2-D array which contains company's sales data The com
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am