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 a 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 when the program runs. 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 with the following input. 201.24 150.91 270.83 421.51 312.43 422.14 251.85 732.53 271.83 321.55 321.67 641.69 Here is the expected output. Corporation Sales Report DIV Q1 Q2 Q3 Q4 201.24 150.91 270.83 421.51 1. 312.43 422.14 251.85 732.53 271.83 321.55 321.67 641.69

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Can you write this code using c++? Thank you!

16
17
#include <iostream>
18
#include <iomanip>
19
20
using namespace std;
21
22
const int QUARTERS
4;
23
24
// Write the prototype of printSalseData here.
25
26
27 int main() {
double salesData [3] [QUARTERS] {0};
for (int div
for (int qtr
28
29 E
30 E
0; div < 3; ++div) {
0; qtr < QUARTERS; ++qtr) {
31
cin >> salesData[div][qtr];
}
// Complete the call statement below.
printSalesData();
34
35
36
return 0;
37
}
38
39
// Write the definition of printSalseData here.
40
41
42
43
O H N
M M M M
Transcribed Image Text:16 17 #include <iostream> 18 #include <iomanip> 19 20 using namespace std; 21 22 const int QUARTERS 4; 23 24 // Write the prototype of printSalseData here. 25 26 27 int main() { double salesData [3] [QUARTERS] {0}; for (int div for (int qtr 28 29 E 30 E 0; div < 3; ++div) { 0; qtr < QUARTERS; ++qtr) { 31 cin >> salesData[div][qtr]; } // Complete the call statement below. printSalesData(); 34 35 36 return 0; 37 } 38 39 // Write the definition of printSalseData here. 40 41 42 43 O H N M M M M
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 a 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 when the program runs.
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 with the following input.
201.24
150.91
270.83
421.51
312.43
422.14
251.85
732.53
271.83
321.55
321.67
641.69
Here is the expected output.
Corporation Sales Report
DIV
Q1
Q2
Q3
Q4
201.24
150.91
270.83
421.51
1
312.43
422.14
251.85
732.53
271.83
321.55
321.67
641.69
Transcribed Image Text: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 a 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 when the program runs. 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 with the following input. 201.24 150.91 270.83 421.51 312.43 422.14 251.85 732.53 271.83 321.55 321.67 641.69 Here is the expected output. Corporation Sales Report DIV Q1 Q2 Q3 Q4 201.24 150.91 270.83 421.51 1 312.43 422.14 251.85 732.53 271.83 321.55 321.67 641.69
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education