Chapter 3.1 : Blocks, Loops, and Branches Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the six control structures?

A
  1. block
  2. while
  3. do while
  4. for
  5. if
  6. switch
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the block statement do?

A

It groups a sequence of statements into a single statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the 2 classes of structures?

A
  1. loop

2. branching

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a while loop used to do?

A

Repeat a given statement over and over

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does a while statement begin with?

A

a boolean expression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly