Study the program shown below, and then answer the questions. The company array contains the amounts the company sold both domestically and internationally during the months of January through June. The first row contains the domestic sales for the six months. The second row contains the international sales during the same period. 1 #include 2 using namespace std; 3 4 int main(). 5e { int company[2][6] {{75000, з0200, 67800, 45000, б0өөө, 67500)}, {40000, 75000, 64000, 32600, 47800, 39000}}; 10 int companySales = 0; for (int location = 0; location < 2; location += 1) for (int month = 0; month < 6; month += 1) companySales += company[location][month]; //end for //end for 12 13 14 15 16 17 18 cout <« "Company sales: $" « companySales « endl; return 0; 19 20 } //end of main function QUESTIONS 1. What value is stored in the company[ 1]I5]element? 2. How can you calculate the total company sales made in February? 3. What is the highest row subscript in the company array? What is the highest column subscript in the array? 4. If the January domestic sales are stored in the company[0I0] element, where are the January international sales stored? 5. If you change the for clause in Line 13 to for (int month = 1; month <= 6; month += 1), how will the change affect the assignment statement in the for loop? 67 O H N m ¢ n 67 00

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
9:54 * 49 9.00
KB/S
i nttps://drive.google.com/çile/d/1l
4
COMPUTER COMMUNICATION DEVELOPMENT INSTITUTE
Learning Management System
PREFINAL TASK 1
Study the program shown below, and then answer the questions. The company array
contains the amounts the company sold both domestically and internationally during the months of
January through June. The first row contains the domestic sales for the six months. The second row
contains the international sales during the same period.
1 #include<iostream>
2 using namespace std;
3
int main()
5E {
4
int company[2][6] = {{75000, 30200, 67800,
45000, 60000, 67500},
{40000, 750өө, 64000,
32600, 4780ө, 39000}};
7
9
10
int companySales = 0;
11
12
for (int location = 0; location < 2; location += 1)
for (int month = 0; month < 6; month += 1)
companySales += company[location][month];
//end for
//end for
13
14
15
16
17
cout <« "Company sales: $" << companySales << endl;
return 0;
18
19
20 } //end of main function
QUESTIONS
1. What value is stored in the company[1][5] element?
2. How can you calculate the total company sales made in February?
3. What is the highest row subscript in the company array? What is the highest column
subscript in the array?
4. If the January domestic sales are stored in the company[0I0] element, where are the
January international sales stored?
5. If you change the for clause in Line 13 to for (int month = 1; month <= 6; month += 1), how will
the change affect the assignment statement in the for loop?
6.
Course: Intermediate Programming
Instructor: Aaron Paul L. Ramos
E-mail: aplramos2011@yahoo.com
www.ccdisorsogon.edu.ph
Transcribed Image Text:9:54 * 49 9.00 KB/S i nttps://drive.google.com/çile/d/1l 4 COMPUTER COMMUNICATION DEVELOPMENT INSTITUTE Learning Management System PREFINAL TASK 1 Study the program shown below, and then answer the questions. The company array contains the amounts the company sold both domestically and internationally during the months of January through June. The first row contains the domestic sales for the six months. The second row contains the international sales during the same period. 1 #include<iostream> 2 using namespace std; 3 int main() 5E { 4 int company[2][6] = {{75000, 30200, 67800, 45000, 60000, 67500}, {40000, 750өө, 64000, 32600, 4780ө, 39000}}; 7 9 10 int companySales = 0; 11 12 for (int location = 0; location < 2; location += 1) for (int month = 0; month < 6; month += 1) companySales += company[location][month]; //end for //end for 13 14 15 16 17 cout <« "Company sales: $" << companySales << endl; return 0; 18 19 20 } //end of main function QUESTIONS 1. What value is stored in the company[1][5] element? 2. How can you calculate the total company sales made in February? 3. What is the highest row subscript in the company array? What is the highest column subscript in the array? 4. If the January domestic sales are stored in the company[0I0] element, where are the January international sales stored? 5. If you change the for clause in Line 13 to for (int month = 1; month <= 6; month += 1), how will the change affect the assignment statement in the for loop? 6. Course: Intermediate Programming Instructor: Aaron Paul L. Ramos E-mail: aplramos2011@yahoo.com www.ccdisorsogon.edu.ph
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY