Question: Question 18 (4 points) Question 18 Unsaved In the code shown below, the computer continues processing the inner loops instructions until the user enters __________,

Question 18 (4 points) Question 18 Unsaved

In the code shown below, the computer continues processing the inner loops instructions until the user enters __________, at which time the inner loop ends.

int sales = 0;

int region = 1;

int totRegSales = 0;

while (region < 3)

{

cout << "First sales amount for Region "

<< region << ": ";

cin >> sales;

while (sales > 0)

{

totRegSales = totRegSales + sales;

cout << "Next sales amount for Region "

<< region << ": ";

cin >> sales;

} //end while

cout << endl << "Region " << region << " sales: $"

<< totRegSales << endl << endl;

region = region + 1;

totRegSales = 0;

} //end while

cout << "End of program" << endl;

Question 18 options:

a. a negative number

b. either the number 0 or a negative number

c. a number greater or equal than 3

d. the number 0

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!