Chapter 3.1 : Blocks, Loops, and Branches Flashcards
1
Q
What are the six control structures?
A
- block
- while
- do while
- for
- if
- switch
2
Q
What does the block statement do?
A
It groups a sequence of statements into a single statement
3
Q
What are the 2 classes of structures?
A
- loop
2. branching
4
Q
What is a while loop used to do?
A
Repeat a given statement over and over
5
Q
What does a while statement begin with?
A
a boolean expression
6
Q
What does an if statement do?
A
It tells the computer to take one of two alternative courses of action, depending on whether the value of a given boolean valued expression is true or false