Exam 4: Fundamental Data Types

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

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

(Multiple Choice)
4.9/5
(44)

Assuming that the user enters 45 and 62 as inputs for n1 and n2, respectively, what is the output of the following code snippet? Assuming that the user enters 45 and 62 as inputs for n1 and n2, respectively, what is the output of the following code snippet?

(Multiple Choice)
5.0/5
(38)

Assume the following variables have been declared and given values as shown: String str = "0123456789"; String sub = str.substring(3, 4); Which is the value of sub?

(Multiple Choice)
4.8/5
(34)

The problem solving process emphasizes a "first, do-it-by-hand" approach because

(Multiple Choice)
4.8/5
(26)

What is the difference between the result of the following two Java statements? I.int cents = (int)(100 * price + 0.5); II.int cents = (100 * price + 0.5);

(Multiple Choice)
4.7/5
(39)

What happens to the fractional part when a division is performed on two integer variables?

(Multiple Choice)
4.8/5
(36)

What is the result of the following code snippet? What is the result of the following code snippet?

(Multiple Choice)
4.8/5
(29)

Assuming that the user enters 23 and 45 as inputs for num1 and num2, respectively, what is the output of the following code snippet? Assuming that the user enters 23 and 45 as inputs for num1 and num2, respectively, what is the output of the following code snippet?

(Multiple Choice)
4.8/5
(33)

What will be printed by the statements below? What will be printed by the statements below?

(Multiple Choice)
4.9/5
(29)

Which of the following statements is correct about constants?

(Multiple Choice)
4.7/5
(48)

Which one of the following is a correct method for defining and initializing an integer variable with name value?

(Multiple Choice)
4.9/5
(42)

What is wrong with the following code snippet? What is wrong with the following code snippet?

(Multiple Choice)
4.8/5
(40)

How do you extract the first 5 characters from the string str?

(Multiple Choice)
4.8/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? 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?

(Multiple Choice)
4.9/5
(35)

Suppose a phone number, stored as a ten-character string (of digits only) called phoneNumber must be converted into a string that has parentheses around the area code.Which statement below will do that?

(Multiple Choice)
4.9/5
(37)

Which one of the following operators computes the remainder of an integer division?

(Multiple Choice)
4.8/5
(36)

What will be the value stored in the variable x after the execution of the following code snippet? What will be the value stored in the variable x after the execution of the following code snippet?

(Multiple Choice)
4.9/5
(32)

What is the output of the following code snippet? What is the output of the following code snippet?

(Multiple Choice)
4.8/5
(38)

What will be the value of the variables x and y after the given set of assignments? What will be the value of the variables x and y after the given set of assignments?

(Multiple Choice)
4.8/5
(44)

Which is the mathematical equivalent of the following Java expression? Which is the mathematical equivalent of the following Java expression?

(Multiple Choice)
4.9/5
(44)
Showing 101 - 120 of 124
close modal

Filters

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