• Home
  • Textbooks
  • Starting Out with Programming Logic and Design
  • Repetition Structures

Starting Out with Programming Logic and Design

Tony Gaddis

Chapter 5

Repetition Structures - all with Video Answers

Educators


Chapter Questions

02:17

Problem 1

What is a repetition structure?

Sanchit Jain
Sanchit Jain
Numerade Educator
03:18

Problem 2

What is a condition-controlled loop?

Eric Ferrara
Eric Ferrara
Numerade Educator
03:18

Problem 3

What is a count-controlled loop?

Eric Ferrara
Eric Ferrara
Numerade Educator
02:13

Problem 4

What is a loop iteration?

Faizanullah Kazmi
Faizanullah Kazmi
Numerade Educator
04:35

Problem 5

What is the difference between a pretest loop and a posttest loop?

Willis James
Willis James
Numerade Educator
04:35

Problem 6

Does the while loop test its condition before or after it performs an iteration?

Willis James
Willis James
Numerade Educator
04:35

Problem 7

Does the Do-While loop test its condition before or after it performs an iteration?

Willis James
Willis James
Numerade Educator
02:17

Problem 8

What is an infinite loop?

Alan Mullenix
Alan Mullenix
Numerade Educator
04:35

Problem 9

What is the difference between a Do-While loop and a Do-Until loop?

Willis James
Willis James
Numerade Educator
01:24

Problem 10

What is a counter variable?

Brian Lin
Brian Lin
Numerade Educator
01:21

Problem 11

What three actions do count-controlled loops typically perform using the counter variable?

Adam Conner
Adam Conner
Numerade Educator
01:43

Problem 12

When you increment a variable, what are you doing? When you decrement a variable, what are you doing?

Adam Conner
Adam Conner
Numerade Educator
02:00

Problem 13

Look at the following pseudocode. If it were a real program, what would it display?
Declare Integer number = 5 Set number $=$ number +1 Display number

Mayank Tripathi
Mayank Tripathi
Numerade Educator
View

Problem 14

Look at the following pseudocode. If it were a real program, what would it
display?
Declare Integer counter
For counter = 1 To 5
Display counter
End For

Gio Maya
Gio Maya
Numerade Educator
02:00

Problem 15

Look at the following pseudocode. If it were a real program, what would it
display?
Declare Integer counter
For counter = 0 To 500 Step 100
Display counter
End For

Mayank Tripathi
Mayank Tripathi
Numerade Educator
02:00

Problem 16

Look at the following pseudocode. If it were a real program, what would it
display?
Declare Integer counter = 1
Constant Integer MAX = 8
While counter <= MAX
Display counter
Set counter = counter + 1
End While

Mayank Tripathi
Mayank Tripathi
Numerade Educator
02:00

Problem 17

Look at the following pseudocode. If it were a real program, what would it
display?
Declare Integer counter = 1
Constant Integer MAX = 7
While counter <= MAX
Display counter
Set counter = counter + 2
End While

Mayank Tripathi
Mayank Tripathi
Numerade Educator
02:00

Problem 18

Look at the following pseudocode. If it were a real program, what would it
display?
Declare Integer counter
Constant Integer MIN = 1
For counter = 5 To MIN Step -1
Display counter
End For

Mayank Tripathi
Mayank Tripathi
Numerade Educator
06:30

Problem 19

A program that calculates the total of a series of numbers typically has what two elements?

Bryan Lynn
Bryan Lynn
Numerade Educator
01:12

Problem 20

What is an accumulator?

Narayan Hari
Narayan Hari
Numerade Educator
01:42

Problem 21

Should an accumulator be initialized to any specific value? Why or why not?

Adam Conner
Adam Conner
Numerade Educator
05:11

Problem 22

Look at the following pseudocode. If it were a real program, what would it
display?
Declare Integer number1 = 10, number2 = 5
Set number1 = number1 + number2
Display number1
Display number2

Kumareshwaran Rathinasabapathy
Kumareshwaran Rathinasabapathy
Numerade Educator
03:28

Problem 23

Look at the following pseudocode. If it were a real program, what would it
display?
Declare Integer counter, total = 0
For counter = 1 To 5
Set total = total + counter
End For
Display total

RO
Reynald Oliveria
Numerade Educator
00:32

Problem 24

What is a sentinel?

Courtney Burson
Courtney Burson
Numerade Educator
01:03

Problem 25

Why should you take care to choose a unique value as a sentinel?

Gus Steppen
Gus Steppen
Numerade Educator