Question
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?
- while (age < 0)
- while age >= 0;
- while (age !> 0)
- 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.
- closing
- 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.
- entering
- initializer
- initializing
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started