Exam 2: Fundamental Data Types

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

What is wrong with the following code snippet? Int average; Average = 78A;

(Multiple Choice)
5.0/5
(40)

Which one of the following statements defines a constant with the value 123?

(Multiple Choice)
4.8/5
(41)

What is the value of Math.abs(-2)?

(Multiple Choice)
4.8/5
(33)

What is the output of the following code snippet? System.out.printf("%5.3f", 20.0);

(Multiple Choice)
4.8/5
(35)

Which of the following statements displays Price = 20.00

(Multiple Choice)
4.8/5
(34)

Which of the following statements about constants in Java are true? I. Although not required, constants are commonly named using uppercase letters II. Only integer values can appear as constants III. A variable can be defined with an initial value, but the reserved word final prevents it from being changed IV. A named constant makes computations that use it clearer

(Multiple Choice)
4.7/5
(33)

Which is the Java equivalent of the following mathematical expression? C = (√a + √b)2

(Multiple Choice)
4.9/5
(29)

One way to avoid round-off errors is to use:

(Multiple Choice)
5.0/5
(35)

Which of the following is the Java equivalent of the following mathematical expression? C = 2 π\pi . radius

(Multiple Choice)
4.8/5
(31)

Which one of the following refers to a number constant that appears in code without explanation?

(Multiple Choice)
4.9/5
(31)

What is wrong with the following code snippet? Int price; Price = 9.42;

(Multiple Choice)
4.7/5
(39)

What is the output of the following code snippet? Public static void main(String[] args) { Double x; X = Math.pow(3.0, 2.0) + Math.pow(4.0, 2.0); System.out.println(x); }

(Multiple Choice)
4.9/5
(40)

Which of the following is the mathematical equivalent of the following Java expression? H = (4.0 * a * b - Math.pow(b, 2)) / c;

(Multiple Choice)
4.8/5
(35)

Which is the appropriate time to initialize a variable?

(Multiple Choice)
4.7/5
(33)

Which statement about number literals in Java is false?

(Multiple Choice)
4.8/5
(35)

What is wrong with the following code? Int count = 2000 * 3000 * 4000;

(Multiple Choice)
4.7/5
(38)

What is the value inside the var variable at the end of the given code snippet? Public static void main(String[] args) { Int var = 30; Var = var + 2 / var; Var++; }

(Multiple Choice)
4.8/5
(40)

What is the output of the following code snippet? Public static void main(String[] args) { Int value = 25; Value = value * 2; Value--; System.out.println(value); }

(Multiple Choice)
4.8/5
(39)

What does the following statement sequence print? String str = "Java"; Str += " is powerful"; System.out.println(str);

(Multiple Choice)
4.8/5
(41)

In an airline reservation system, the number of available seats in an airplane is required. Which data type should be used to store this value?

(Multiple Choice)
5.0/5
(38)
Showing 21 - 40 of 103
close modal

Filters

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