COP2253 Zybooks Chapter Three Flashcards

1
Q

branch

A

a program path taken only if an expression’s value is true

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

if-else structure

A

two branches, one taken if an expression is true, else the other branch is taken (else may be ommitted)

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

if statement

A

executes a group of statements if an expression is true

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

braces

A

{}

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

brackets

A

[]

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

equality operator

A

==

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

nested if-else

A

the branch of one if-else statement contains another if-else statement

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

Boolean

A

a type that has just two values, true or false

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

relational operator

A

checks how one operand’s value relates to another (, <=, >=)

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

logical operator

A

treats operands as being true or false, and evaluates to true or false (include AND, OR, NOT)

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

logical AND

A

&&

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

logical OR

A

||

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

logical NOT

A

!

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

switch statement

A

executes the first case whose constant expression matches the value of the switch expression, executes the case’s statements, and then jumps to the end: break statement (if there is no matching case, then default statements are executed)

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

equals method (equalsIgnoreCase)

A

used to compare strings, returns true if strings are equal

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

index (starting at 0)

A

the position number of each character in a string

17
Q

charAt(x)

A

determines the character at index x of a string

18
Q

.length()

A

returns the length of a string

19
Q

exception

A

a detected runtime error that commonly prints an error message and terminates the program

20
Q

strings are immutable meaning:

A

they cannot be changed

21
Q

conditional expression

A

has the form

condition ? exprWhenTrue : exprWhenFalse

22
Q

short circuit evaluation

A

skips evaluating later operands if the result of the logical operator can already be determined