Question: Refer to the C++ code below to answer question: int main() { int company[2][6] = {{12000, 45000, 32000, 67000, 24000, 55000}, {10000, 56000, 42000, 23000,
Refer to the C++ code below to answer question:
int main() { int company[2][6] = {{12000, 45000, 32000, 67000, 24000, 55000}, {10000, 56000, 42000, 23000, 12000, 34000}}; 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
cout << "Company Sales: $" << companySales << endl; return 0; } ///////////////////////////////////////////////////////////////////
Detailed Question:
What value is stored in the company[1][5] element? How can you calculate the total company sales made in February? What is the highest row subscript in the company array? What is the highest column subscript in the array? If the January domestic sales are stored in the company[0][0] element, where are the January international sales stored? If you change the for clause in Line 18 to for (int month = 1; month <= 6; month += 1), how will the change affect the assignment statement in the for loop?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
