Chapter 3 Flashcards

1
Q

the if(condition) must be

A

a boolean, true or false

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

If the condition is true

A

the statement is executed, if not skipped

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

==

A

equals

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

!=

A

does not equal

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

<=

A

less than or equal to

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

> =

A

greater than or equal to

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

else is similar to

A

otherwise

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

Without braces

A

only one statement can follow the if statement

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

a && b

A

if both a and b are true, executes

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

a || b

A

If either a or b are true, executes

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

!a

A

executes if a is false

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

&& and || are

A

binary operators

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

order of logical precedence

A

NOT over AND and OR

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

De Morgan’s theorem

A

When the not (!) is distributed to the variable in the parentheses

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

short circuiting

A

when the left operand of an “&&” statement or “||” is true, other part is not evaluated

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

How to compare strings

A

“equals method” and

“compareTo”

17
Q

lexicographic ordering

A

Compares characters and Strings based on a character set

alphabetical order, and short strings with same prefix as long go first

“book” before “bookcase”

18
Q

increment operator ++

A

adds one to its operand

19
Q

decrement operator –

A

subtracts one from its operand

20
Q

num += count is equal to

A

num = num + count;

21
Q

num -= count is equal to

A

num = num- count

22
Q

num *= count is equal to

23
Q

num /= count is equal to

24
Q

num %= count is equal to

25
can add up
assignment operators
26
repetition statements
while and for loops
27
If a while loop does not eventually make the condition false
it is an infinite loop
28
for loops execute a specific number of times
yes
29
how to establish for loop
for(initialize; condition; increment)
30
algorithm
step by step process for solving a problem
31
psuedo code
helps to solve algorithm, mix of English and code
32
top-down development
starts at top, priority code, and goes down
33
regression testing
running programs over and over to find problem
34
flow of control
program runs from one line to the next until program is complete