Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. Which of the following while clauses tells the computer to exit the loop when in the age variable is less than the number 0?

5. Which of the following while clauses tells the computer to exit the loop when in the age variable is less than the number 0?

  1. while (age < 0)
  2. while age >= 0;
  3. while (age !> 0)
  4. while (age >= 0)

6. Which of the following is a good sentinel value for a program that allows the enter a person's age?

a. -4.

b. 350

C. 999

d. all of the above

7. Values that are used to end loops are referred to as

values.

  1. closing
  2. ending

C. sentinel

d. stop

8. A program allows the user to enter one or more numbers. The first input instr get the first number only and is referred to as the

read.

  1. entering
  2. initializer
  3. initializing
  4. priming

How many times will the computer process the cout << numTimes << end1; statement in the following code?

int numTimes = 0;

while (numTimes > 3)

{

cout << numTimes << endl;

numTimes += 1;

//end while

a. 0

b. 1

C.3

d. 4

10. How many times will the computer process the cout << numTimes << end; statement in the following code?

for (int numTimes = 1; numTimes < 6; numTimes += 1)

cout << numTimes << endl;

end for

a.0

b.1

c.5

d.6

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions

Question

U11 Informing Industry: Publicizing Contract Actions 317

Answered: 1 week ago