Exam 4: Fundamental Data Types

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

Which one of the following statements can be used to extract the last 10 characters from the string variable str?

(Multiple Choice)
4.8/5
(38)

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

Which of the following options defines an integer variable?

(Multiple Choice)
5.0/5
(43)

What is the value of Math.pow(2, 3)?

(Multiple Choice)
4.8/5
(37)

Assuming that the user inputs "Joe" at the prompt, what is the output of the following code snippet? public static void main(String[] args) { System.out.print("Enter your name "); String name; Scanner in = new Scanner(System.in); Name = in.next(); Name += ", Good morning"; System.out.print(name); }

(Multiple Choice)
4.9/5
(42)

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

(Multiple Choice)
4.9/5
(39)

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

(Multiple Choice)
4.9/5
(50)

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

Assuming that the user enters 23 and 45 as inputs for num1 and num2, respectively, what is the output of the following code snippet? public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter a number: "); String num1 = in.next(); System.out.print("Enter another number: "); String num2 = in.next(); System.out.println(num1 + num2); }

(Multiple Choice)
4.8/5
(31)

What is the result of the following expression? double d = 2.5 + 4 * -1.5 - (2.5 + 4) * -1.5;

(Multiple Choice)
4.8/5
(42)

The first step in problem solving is

(Multiple Choice)
4.9/5
(31)

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

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

How do you compute the length of the string str?

(Multiple Choice)
5.0/5
(30)

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

What is the output of this code snippet? double average; Int grade1 = 87; Int grade2 = 94; // System.out.print("The average is " + (grade1 + grade2) / 2.0); System.out.print("The average is " + average);

(Multiple Choice)
4.8/5
(36)

Which one of the following statements displays the output as +000321.00?

(Multiple Choice)
4.8/5
(42)

Which of the following statements places input into the variable value given this line of code? Scanner in = new Scanner(System.in);

(Multiple Choice)
4.9/5
(41)

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

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.9/5
(34)
Showing 81 - 100 of 125
close modal

Filters

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