Exam 3: Decision Structures

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

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

(True/False)
4.8/5
(37)

What does the following code display? double x = 12.3798146; System.out.printf("%.2f \ n",x);

(Multiple Choice)
4.8/5
(38)

An important style rule you should follow when writing if statements is to line up the conditionally executed statement with the if statement.

(True/False)
4.7/5
(29)

The expression tested by an if statement must evaluate to

(Multiple Choice)
4.8/5
(35)

What would be the value of discountRate after the following statements are executed? double discountRate; Char custType = 'B'; Switch (custType) { Case 'A': DiscountRate = .08; Break; Case 'B': DiscountRate = .06; Case 'C': DiscountRate = .04; Default: DiscountRate = 0.0; }

(Multiple Choice)
4.9/5
(32)

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.7/5
(32)

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
(39)

Because the && operator performs short-circuit evaluation,your boolean expression will usually execute faster if the subexpression that is most likely false is on the left of the && operator.

(True/False)
4.9/5
(33)

In Java,when a character is stored in memory,it is actually stored as a(n)_____.

(Multiple Choice)
5.0/5
(30)

What would be the value of bonus after the following statements are executed? int bonus,sales = 85000; Char dept = 'S'; If (sales > 100000) If (dept == 'R') Bonus = 2000; Else Bonus = 1500; Else if (sales > 75000) If (dept == 'R') Bonus = 1250; Else Bonus = 1000; Else Bonus = 0;

(Multiple Choice)
4.8/5
(44)

Enclosing a group of statements inside a set of braces creates a

(Multiple Choice)
4.8/5
(31)

What would be the value of x after the following statements were executed? int x = 10; Switch (x) { Case 10: X += 15; Case 12: X -= 5; Break; Default: X *= 3; }

(Multiple Choice)
4.9/5
(33)

If str1 and str2 are both Strings,which of the following expressions will correctly determine whether they are equal? (1)(str1 == str2) (2)str1.equals(str2) (3)(str1.compareTo(str2)== 0)

(Multiple Choice)
4.9/5
(38)

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

(True/False)
4.9/5
(38)

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

(Multiple Choice)
4.8/5
(32)

A flag may have the values

(Multiple Choice)
4.8/5
(39)

A local variable's scope always ends at the closing brace of the block of code in which it is declared.

(True/False)
4.8/5
(31)

These operators are used to determine whether a specific relationship exists between two values.

(Multiple Choice)
4.9/5
(31)

To do a case insensitive compare which of the following could be used to test the equality of two strings,str1 and str2?

(Multiple Choice)
4.7/5
(26)

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
(49)
Showing 21 - 40 of 52
close modal

Filters

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