Deck 7: Control Statements Continued
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/47
Play
Full screen (f)
Deck 7: Control Statements Continued
1
The OR operator has the same precedence as + or -.
False
2
Most errors involving selection statements and loops are syntax errors.
False
3
An animated object moving in the direction of 180 degrees is moving east. ____________________
False
4
The expression !(p | | q) is equal to ____.
A) !p && !q
B) !(p && q)
C) !p | | !q
D) | | (!p !q)
A) !p && !q
B) !(p && q)
C) !p | | !q
D) | | (!p !q)
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
5
In the sentence "If the sun is shining AND it is 8
A) If both operands are true, the condition as a whole is true.
A)m. then let's go for a walk; else let's stay home," which of the following is true?
B) If both operands are false, the condition is false.
C) If either operand is false, the condition is false.
D) All of the above are true.
A) If both operands are true, the condition as a whole is true.
A)m. then let's go for a walk; else let's stay home," which of the following is true?
B) If both operands are false, the condition is false.
C) If either operand is false, the condition is false.
D) All of the above are true.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
6
When evaluating an if statement, if there are two operands, there are four possibilities.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
7
In Java, the nested statement provides an alternative to the extended if statement. ____________________
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
8
The presence of looping statements increases the challenge of designing good test data.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
9
Complete code coverage tests all of the logical paths through a program.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
10
A string is an immutable object; once it is created, its length cannot change and its characters cannot be modified. ____________________
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
11
Use a truth table if you are unsure about the meaning of an if statement.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
12
In animations, faster objects can travel a greater distance between frames than slower ones.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
13
In Java, the operator OR is represented by ____.
A) &&
B) | |
C) !
D) < >
A) &&
B) | |
C) !
D) < >
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
14
The process of short-circuit evaluation ____.
A) identifies potential run-time errors
B) identifies potential logic errors
C) stops the evaluation of a Boolean expression once it knows the value
D) creates robust programs
A) identifies potential run-time errors
B) identifies potential logic errors
C) stops the evaluation of a Boolean expression once it knows the value
D) creates robust programs
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
15
An assert statement allows the programmer to evaluate a Boolean expression and halt the program with an error message if the expression's value is false. ____________________
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
16
Using equivalences enables you to rewrite a condition in a more easily understood form.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
17
In Java, the operator NOT is represented by ____.
A) &&
B) | |
C) !
D) < >
A) &&
B) | |
C) !
D) < >
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
18
A Boolean variable can be either true or false. ____________________
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
19
Circles have an initial speed of 0 and an initial direction of 0 degrees.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
20
Indentation is a convention that indicates relationships and precedence to the compiler.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
21
FIGURE 7-2 
Figure 7-2 shows the output of a program that includes a(n) ____.
A) arithmetic overflow
B) data validation
C) boundary condition
D) assert statement

Figure 7-2 shows the output of a program that includes a(n) ____.
A) arithmetic overflow
B) data validation
C) boundary condition
D) assert statement
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
22
FIGURE 7- 1 
Figure 7-1 above is a(n) ____.
A) flowchart
B) truth table
C) evaluation grid
D) rule table

Figure 7-1 above is a(n) ____.
A) flowchart
B) truth table
C) evaluation grid
D) rule table
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
23
A combinatorial explosion is ____.
A) a type of run-time error
B) what happens when the JVM throws an exception
C) the multiplicative growth in test cases
D) a sign that your program is not robust
A) a type of run-time error
B) what happens when the JVM throws an exception
C) the multiplicative growth in test cases
D) a sign that your program is not robust
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
24
When a timer is instantiated, it is given an interval in milliseconds and a(n) ____ object.
A) listener
B) direction
C) speed
D) distance
A) listener
B) direction
C) speed
D) distance
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
25
A(n) ____ if statement is another word for an extended if statement.
A) multiway
B) nested
C) two-way
D) looped
A) multiway
B) nested
C) two-way
D) looped
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
26
A loop ____ is an assertion whose truth changes between the first and final execution of the loop.
A) validation
B) mutator
C) invariant
D) variant
A) validation
B) mutator
C) invariant
D) variant
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
27
A(n) ____ object can be used to read words from a string.
A) substring
B) char
C) reader
D) Scanner
A) substring
B) char
C) reader
D) Scanner
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
28
____________________ assurance is the process of making sure that a software product is developed to the highest standards possible.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
29
Testing under ____________________ conditions uses data at the limits of validity.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
30
A(n) ____ loop is placed within another loop.
A) double
B) embedded
C) nested
D) You cannot put a loop inside another loop.
A) double
B) embedded
C) nested
D) You cannot put a loop inside another loop.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
31
At minimum, test data should try to achieve ____.
A) boundary conditions
B) complete code coverage
C) extreme conditions
D) short-circuit evaluation
A) boundary conditions
B) complete code coverage
C) extreme conditions
D) short-circuit evaluation
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
32
To implement the ____________________ ( ) method, calculate the distances in the x and y directions based on the object's current position, its speed, and its direction.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
33
A ____________________ program tolerates errors in user inputs and recovers gracefully.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
34
All the sets of test data that exercise a program in the same manner belong to the same ____ class.
A) assurance
B) boundary
C) logical
D) equivalence
A) assurance
B) boundary
C) logical
D) equivalence
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
35
Use the ____ operator to wrap the direction of a moving object if it is greater than 360 degrees.
A) +
B) >
C) | |
D) %
A) +
B) >
C) | |
D) %
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
36
Among other things, AI systems have been used to control ____.
A) robots
B) data validation
C) programming languages
D) compilation
A) robots
B) data validation
C) programming languages
D) compilation
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
37
A loop ____ is an assertion that expresses a relationship between variables that remains constant throughout all iterations of the loop.
A) validation
B) operator
C) invariant
D) variant
A) validation
B) operator
C) invariant
D) variant
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
38
Jinling is testing a loop that has errors. She should check the value of the control variable loop at all of the following points EXCEPT ____.
A) before the loop is entered
B) in the middle of each iteration
C) after each update
D) after the loop is exited
A) before the loop is entered
B) in the middle of each iteration
C) after each update
D) after the loop is exited
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
39
The method "equals (aString)" returns a(n) ____ value.
A) int
B) boolean
C) char
D) object
A) int
B) boolean
C) char
D) object
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
40
A(n) ____ assertion states what should be true before a loop is entered
A) input
B) output
C) invariant
D) variant
A) input
B) output
C) invariant
D) variant
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
41
What is a truth table used for? What other tool might you use for the same purpose? How do you know how many possibilities to include in the table?
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
42
Java uses a special type of object called a(n) ____________________ to schedule events at regular intervals.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
43
Identify the letter of the choice that best matches the phrase or definition.
a.Javish
b.Boundary conditions
c.Data validation rules
d.Output assertions
e.Arithmetic overflow
Test data that assesses on or near the limits of the equivalence classes.
a.Javish
b.Boundary conditions
c.Data validation rules
d.Output assertions
e.Arithmetic overflow
Test data that assesses on or near the limits of the equivalence classes.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
44
Identify the letter of the choice that best matches the phrase or definition.
a.Javish
b.Boundary conditions
c.Data validation rules
d.Output assertions
e.Arithmetic overflow
A statement in a combination of code, words, and syntax.
a.Javish
b.Boundary conditions
c.Data validation rules
d.Output assertions
e.Arithmetic overflow
A statement in a combination of code, words, and syntax.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
45
Identify the letter of the choice that best matches the phrase or definition.
a.Javish
b.Boundary conditions
c.Data validation rules
d.Output assertions
e.Arithmetic overflow
When numeric data falls outside of the valid range.
a.Javish
b.Boundary conditions
c.Data validation rules
d.Output assertions
e.Arithmetic overflow
When numeric data falls outside of the valid range.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
46
Identify the letter of the choice that best matches the phrase or definition.
a.Javish
b.Boundary conditions
c.Data validation rules
d.Output assertions
e.Arithmetic overflow
State what should be true when a loop is exited.
a.Javish
b.Boundary conditions
c.Data validation rules
d.Output assertions
e.Arithmetic overflow
State what should be true when a loop is exited.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
47
Identify the letter of the choice that best matches the phrase or definition.
a.Javish
b.Boundary conditions
c.Data validation rules
d.Output assertions
e.Arithmetic overflow
Values used to test a program.
a.Javish
b.Boundary conditions
c.Data validation rules
d.Output assertions
e.Arithmetic overflow
Values used to test a program.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck