Back to marketplace

Chapter 5: Decisions

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v3•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

What does the if statement allow a program to do?

Back (Answer)

carry out different actions depending on the nature of the data to be processed

#2
Front (Question)

What does a relational operator test?

Back (Answer)

the relationship between two values

#3
Front (Question)

What relationship operators do programmers use to compare numbers?

Back (Answer)

<, <=, >, >=, ==, !=

#4
Front (Question)

Why don’t you check for equality when comparing floating-point numbers?

Back (Answer)

because they’re could be a rounding error. Instead, test whether they are close enough

#5
Front (Question)

What threshhold value do we say is “close enough”

Back (Answer)

10^(-14) OR 1e-14

#6
Front (Question)

T/F: use the == operator to compare strings

Back (Answer)

Fuck NO!

#7
Front (Question)

What method do you use to compare strings?

Back (Answer)

the equal method

#8
Front (Question)

What does the compareTo method do?

Back (Answer)

compares strings in lexographic order

#9
Front (Question)

What is ‘A’ in lexographic order?

Back (Answer)

65

#10
Front (Question)

What is ‘a’ in lexographic order

Back (Answer)

97

#11
Front (Question)

string1.compareTo(string2) == 0 returns true. What is true about the two strings?

Back (Answer)

they are identical

#12
Front (Question)

What would happen if you use the == method on objects?

Back (Answer)

it would test whether two object references are identical

#13
Front (Question)

What method should you use to compare the values of an object?

Back (Answer)

equals

#14
Front (Question)

What does the null reference refer to?

Back (Answer)

no object

#15
Front (Question)

What operator do you use to test whether an object is a null reference?

Back (Answer)

==

#16
Front (Question)

How can you evaluate complex decisions?

Back (Answer)

use multiple if statements

#17
Front (Question)

What order should you test conditions when using multiple if statements?

Back (Answer)

test general conditions after more specific conditions

#18
Front (Question)

When are statements nested?

Back (Answer)

when a descision statement is contained inside the branch of another descision statement

#19
Front (Question)

When are nested descisions required?

Back (Answer)

for problems that have two levels of descision making

#20
Front (Question)

What is black-box testing?

Back (Answer)

a testing method that does not take the structure of the implementation into account

#21
Front (Question)

What is white-box testing?

Back (Answer)

testing that uses information about the structure of a program

#22
Front (Question)

What is code coverage?

Back (Answer)

a measure of how many parts of a program have been tested

#23
Front (Question)

What are boundary test cases?

Back (Answer)

legal values that lie at the boundary of the set of acceptable inpits

#24
Front (Question)

What values does boolean have?

Back (Answer)

true and false