Chapter 3 Flashcards

You may prefer our related Brainscape-certified 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

A

x = x*y

23
Q

num /= count is equal to

A

x = x/y

24
Q

num %= count is equal to

A

x = x%y

25
Q

can add up

A

assignment operators

26
Q

repetition statements

A

while and for loops

27
Q

If a while loop does not eventually make the condition false

A

it is an infinite loop

28
Q

for loops execute a specific number of times

A

yes

29
Q

how to establish for loop

A

for(initialize; condition; increment)

30
Q

algorithm

A

step by step process for solving a problem

31
Q

psuedo code

A

helps to solve algorithm, mix of English and code

32
Q

top-down development

A

starts at top, priority code, and goes down

33
Q

regression testing

A

running programs over and over to find problem

34
Q

flow of control

A

program runs from one line to the next until program is complete