Exam 5: Making Decisions

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags
Match each term with the correct statement below.
Premises:
true and false
Responses:
relational operator
Boolean values
side effect
Correct Answer:
Verified
Premises:
Responses:
true and false
relational operator
(Matching)
4.9/5
(90)

The disadvantage to using the conditional operator is that it ____.

(Multiple Choice)
4.8/5
(70)

When you use nested if statements, you must pay careful attention to placement of any else clauses.

(True/False)
5.0/5
(78)

  Using the flowchart above, which decision statement will correctly check that hoursWorked is greater than or equal to the FULL_WEEK constant? Using the flowchart above, which decision statement will correctly check that hoursWorked is greater than or equal to the FULL_WEEK constant?

(Multiple Choice)
4.9/5
(89)
Match each term with the correct statement below.
Premises:
> or <
Responses:
side effect
pipes
conditional operator
Correct Answer:
Verified
Premises:
Responses:
> or <
side effect
(Matching)
4.9/5
(90)

What is wrong with the following statement? How could you correct it? if(payRate < 5.85 && payRate > 60) System.out.println("Error in pay rate");

(Essay)
4.7/5
(78)
Match each term with the correct statement below.
Premises:
The logical OR operator
Responses:
conditional operator
equality
sequence structure
Correct Answer:
Verified
Premises:
Responses:
The logical OR operator
conditional operator
(Matching)
4.9/5
(73)

You are never required to use a  switch  structure; you can always achieve the same results with ____ statements.

(Multiple Choice)
4.8/5
(90)

____ is a tool that helps programmers plan a program's logic by writing plain English statements.

(Multiple Choice)
4.8/5
(86)

List and explain the keywords used with the switch statement.

(Essay)
4.9/5
(74)

When you execute an if…else statement, only one of the resulting actions takes place depending on the evaluation of the ____ following the if .

(Multiple Choice)
4.9/5
(89)
Match each term with the correct statement below.
Premises:
Used in the OR operator
Responses:
Boolean values
||
ternary operator
Correct Answer:
Verified
Premises:
Responses:
Used in the OR operator
Boolean values
(Matching)
4.9/5
(71)

Why would a programmer use an && operator when using nested if statements?

(Essay)
4.9/5
(83)

The ____ requires three expressions separated with a question mark and a colon.

(Multiple Choice)
4.8/5
(96)

A logical structure called a(n) ____ structure is when one step follows another unconditionally.

(Multiple Choice)
4.7/5
(87)

What is a range check?  Provide an example of a range check using a series of if..else statements using the values defined below. final double HIGH_LIM = 1000.00; final double HIGH_RATE = 0.08; final double MED_LIM = 500.00; final double MED_RATE = 0.06; final double LOW_RATE = 0.05;

(Essay)
4.8/5
(65)

The ____ operator is written as the exclamation point ( ! ).

(Multiple Choice)
4.8/5
(82)
Match each term with the correct statement below.
Premises:
Two ampersands
Responses:
logical AND operator
switch statement
Boolean values
Correct Answer:
Verified
Premises:
Responses:
Two ampersands
logical AND operator
(Matching)
4.8/5
(80)

Both  &  and  |  are valid Java operators, but a single & or | with integer operands operates on individual ____  rather than making comparisons in logical conditions as  &&  and  ||  do.

(Multiple Choice)
4.8/5
(82)

The ____ operator is always evaluated before the OR operator.

(Multiple Choice)
4.9/5
(62)
Showing 61 - 80 of 80
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)