Exam 4: Performing Loops

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Write a program that projects sales goals for a salesperson for the next several years.The user should be prompted for a first year's merchandise sales amount and a number of years to project the goals. For the first year, the salesperson's goal is the current sales amount. After that, sales are projected to grow at a rate of 8 percent per year. You should use a do-while loop.

(Essay)
4.9/5
(35)

The while loop and the for loop are ____ loops.

(Multiple Choice)
4.8/5
(40)

The most difficult aspect of working with ____ loops is keeping track of the separate loop control variables that direct the program's execution.

(Multiple Choice)
4.9/5
(37)

Most often the evaluate part of the for statement compares the loop control variable with a ____________________ or limit.

(Short Answer)
4.8/5
(40)

It is preferable to initialize loop control variables at the beginning of a program.

(True/False)
4.9/5
(24)
Match each term with the correct statement below.
Premises:
controls the execution of a loop body
Responses:
while loop
loop body
garbage value
Correct Answer:
Verified
Premises:
Responses:
controls the execution of a loop body
while loop
(Matching)
4.8/5
(32)

The do-while loop is a(n) ____ loop.

(Multiple Choice)
4.8/5
(34)

What is a priming input statement?

(Essay)
4.8/5
(37)
Match each term with the correct statement below.
Premises:
uninitialized variable
Responses:
while loop
do-while loop
sentinel value
Correct Answer:
Verified
Premises:
Responses:
uninitialized variable
while loop
(Matching)
4.8/5
(30)

The initialize portion of a for loop comes after the evaluate portion.

(True/False)
4.8/5
(38)

If a program runs for several seconds and appears to be doing nothing or produces repeated output, you should suspect an infinite loop.

(True/False)
4.8/5
(40)
Showing 41 - 51 of 51
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)