Exam 3: Decision Structures

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following will format 12.7801 to display as $12.78?

(Multiple Choice)
4.8/5
(81)

Unicode is an international encoding system that is extensive enough to represent ALL the characters of ALL the world's alphabets.

(True/False)
4.9/5
(65)

The String.format method works exactly like the System.out.printf method, except that it does not display the formatted string on the screen.

(True/False)
4.8/5
(81)

________ works like this: If the expression on the left side of the && operator is False, the expression the right side will not be checked.

(Multiple Choice)
4.8/5
(85)

What will be the value of charges after the following code is executed? Double charges, rate = 7.00; Int time = 180; Charges = time <= 119 ? Rate * 2 : Time / 60.0 * rate;

(Multiple Choice)
4.9/5
(72)

This is an international coding system that is extensive enough to represent all the characters of all the world's alphabets:

(Multiple Choice)
4.9/5
(85)

A flag may have the values:

(Multiple Choice)
4.9/5
(79)

When two Strings are compared using the compareTo method, the cases of the two strings are not considered.

(True/False)
4.9/5
(87)

What will be printed when the following code is executed? Int y = 10; If ( y == 10) { Int x = 30; X += y; } System.out.print("x = "); System.out.print(x);

(Multiple Choice)
4.7/5
(73)

The expression tested by an if statement must evaluate to:

(Multiple Choice)
4.9/5
(65)

If you prematurely terminate an if statement with a semicolon, the compiler will:

(Multiple Choice)
4.7/5
(82)

Because the || operator performs short-circuit evaluation, your boolean expression will generally be evaluated faster if the subexpression that is most likely to be true is on the left.

(True/False)
4.9/5
(85)

In a switch statement, if two different values for the CaseExpression would result in the same code being executed, you must have two copies of the code, one after each CaseExpression.

(True/False)
4.8/5
(75)

What would be the value of discountRate after the following statements are executed? Double discountRate = 0.0; Int purchase = 100; If (purchase > 1000) DiscountRate = .05; Else if (purchase > 750) DiscountRate = .03; Else if (purchase > 500) DiscountRate = .01;

(Multiple Choice)
4.8/5
(87)

What is the value of x after the following code has been executed? Int x = 75; Int y = 90; If ( x != y) X += y;

(Multiple Choice)
4.9/5
(66)

What does the following code display? Int d = 9, e = 12; System.out.printf("%d %d\n", d, e);

(Multiple Choice)
4.7/5
(73)

This is a boolean variable that signals when some condition exists in the program:

(Multiple Choice)
4.8/5
(87)

Programs never need more than one path of execution.

(True/False)
4.7/5
(86)

The switch statement is a:

(Multiple Choice)
4.8/5
(80)

The ________ statement is used to make simple decisions in Java.

(Multiple Choice)
4.9/5
(92)
Showing 41 - 60 of 64
close modal

Filters

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