Building Blocks of Code Flashcards

1
Q

Variables must have two things, what are they?

A

All variables must have a name and a data type.

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

In the statement below, which is the variable name?

String myContainer = ‘Leftovers from Monday’’;

A

myContainer

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

If Integer i = 44, what is the value of the result variable in the following statement?

Boolean result = i < 20;

a. True
b. 44
c. False
d. 20

A

c. False

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

How many choices are possible when using one if-else statement?

a. 1
b. 2
c. 0
d. A and B

A

b. 2

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