Exam 2: Fundamental Data Types

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

Which of the given statements generates the following output? \\\"///

(Multiple Choice)
4.9/5
(35)

What is the meaning of x = 0; in Java?

(Multiple Choice)
4.9/5
(44)

Assuming that the user inputs a value of 25 for the price and 10 for the discount rate in the following code snippet, what is the output? Public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter the price: "); Double price = in.nextDouble(); System.out.print("Enter the discount rate: "); Double discount = in.nextDouble(); System.out.println("The new price is " + Price - price * (discount / 100.0)); }

(Multiple Choice)
4.9/5
(37)

Consider the following division statements: I. 22 / 7 II. 22.0 / 7 III. 22 / 7.0 Which of the following is correct?

(Multiple Choice)
4.9/5
(31)

Given the definition final double PI = 3.14159; which of the following is the Java equivalent of the mathematical expression c = π\pi . radius2

(Multiple Choice)
4.9/5
(41)

Consider the following Java variable names: I. 1stInstance II. basicInt% III. empName_ IV. addressLine1 V. DISCOUNT Which of the following options is correct?

(Multiple Choice)
4.8/5
(35)

At what point in the problem-solving process should one write pseudocode?

(Multiple Choice)
4.7/5
(40)

Which one of the following statements gives the absolute value of the floating-point number x = -25.50?

(Multiple Choice)
4.8/5
(40)

What are the values of num1 and num2 after this snippet executes? Double num1 = 4.20; Double num2 = num1 * 10 + 5.0;

(Multiple Choice)
4.8/5
(29)

How do you compute the length of the string str?

(Multiple Choice)
4.8/5
(34)

What (if any) type of error occurs with the following code if the user input is ABC? Public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter a number: "); String str = in.next(); Int count = Integer.parseInt(str); System.out.println("Input is " + count); }

(Multiple Choice)
4.9/5
(42)

The first step in problem solving is

(Multiple Choice)
4.9/5
(38)

What is wrong with the following code snippet? Int size = 42; Cost = 9.99; System.out.println("size = " + size); System.out.println(" cost = " + cost);

(Multiple Choice)
4.9/5
(35)

Which of the following options is valid with reference to the code snippet? Public static void main(String[] args) { Double d = 45.326; Double r = d % 9.0; System.out.println(r); }

(Multiple Choice)
4.9/5
(49)

Which one of the following statements displays the output as (1.23e+02)?

(Multiple Choice)
4.8/5
(31)

Which of the given System.out.print statements generates the following output? ABCDE"\

(Multiple Choice)
4.9/5
(34)

Which operator is used to concatenate two or more strings?

(Multiple Choice)
4.7/5
(27)

What is the output of the following code snippet? Int counter = 0; Counter++; System.out.print("The initial value of the counter is "); System.out.println(count);

(Multiple Choice)
4.9/5
(44)

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

(Multiple Choice)
4.8/5
(32)

Which one of the following reserved words is used in Java to represent a value without a fractional part?

(Multiple Choice)
4.8/5
(36)
Showing 81 - 100 of 103
close modal

Filters

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