Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Big Java Late Objects
Quiz 3: Decisionseasy
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 61
Multiple Choice
What is the output of the following code snippet? String someString1 = "his"; String someString2 = "cycle"; If (someString1.compareTo(someString2) < 0) { System.out.println(someString2) ; } Else { System.out.println(someString1) ; }
Question 62
Multiple Choice
Consider the following code snippet: Int score = 0; Double price = 100; If (score > 0 && price < 200 && price / score > 10) { System.out.println("buy") ; } Which of the following statements is true on the basis of this code snippet?
Question 63
Multiple Choice
What is the output of the following code snippet? Int age = 25; If (age > 30) { System.out.println("You are wise!") ; } Else { System.out.println("You have much to learn!") ; }
Question 64
Multiple Choice
A store applies a 15 percent service charge on all items with a price of at least $150. No service charge is otherwise applicable. Which of the following DOES NOT correctly compute the service charge?
Question 65
Multiple Choice
Assuming that a user enters 22 as the price of an object, which of the following hand-trace tables is valid for the given code snippet? Int price = 0; String status = ""; Scanner in = new Scanner(System.in) ; System.out.print("Please enter object's price: ") ; Price = in.nextInt() ; If (price >= 50) { Status = "reasonable"; If (price >= 75) { Status = "costly"; } } Else { Status = "inexpensive"; If (price <= 25) { Status = "reasonable"; } }
Question 66
Multiple Choice
Which of the following coding techniques can hand-tracing be applied to?
Question 67
Multiple Choice
Assuming that a user enters 10, 20, and 30 as input values one after another, separated by spaces, what is the output of the following code snippet? Int num1 = 0; Int num2 = 0; Int num3 = 0; Scanner in = new Scanner(System.in) ; System.out.print("Enter a number: ") ; Num1 = in.nextInt() ; System.out.print("Enter a number: ") ; Num2 = in.nextInt() ; System.out.print("Enter a number: ") ; Num3 = in.nextInt() ; If (num1 > num2) { If (num1 > num3) { System.out.println(num1) ; } Else { System.out.println(num3) ; } } Else { If (num2 > num3) { System.out.println(num2) ; } Else { System.out.println(num3) ; } }
Question 68
Multiple Choice
Which of the following conditions tests whether the user enters an integer value that will then be assigned to the floor variable? Int floor = 0; Scanner in = new Scanner(System.in) ; System.out.print("Floor: ") ; ( ) . . ) Floor = in.nextInt() ;
Question 69
Multiple Choice
What is the output of the following code snippet? Int num = 100; If (num < 100) { If (num < 50) { Num = num - 5; } Else { Num = num - 10; } } Else { If (num > 150) { Num = num + 5; } Else { Num = num + 10; } } System.out.println(num) ;