Question: answers please QUESTION 22 In a statement: Scanner keyboard = new Scanner (System.in); it reads user input by means of a Scanner, the user types









answers please
QUESTION 22 In a statement: Scanner keyboard = new Scanner (System.in); it reads user input by means of a Scanner, the user types the line of input below, exactly as shown, including that same spacing. What is the statement keyboard.nextDouble(); returned ? Answer "2": 1+2 is 3 and "5.0" squared is 25.0 ! O a. 2 O b.5.0 O c. 25.0 Od."5.0" QUESTION 23 The following two method calls are using what method feature? System.out.println(4.0); System.out.println("4.0"); a. method overriding O b. method parameters O c. method overwriting O d. method overfloating O e. method overloading QUESTION 24 Evaluate the following expression. Make sure to give a value of the appropriate type (such as including a decimal point in a double). 10 + 10 * Math.random()) O a. A number between 10.0 (inclusive) and 20.0 (exclusive) O b. 15.0 O c. A number between 10.0 (inclusive) and 20.0 (inclusive) O d. 10.0 QUESTION 25 Which one complete the code to print out 1 2 3 4 5 int i = 10; while (i = -50) { System.out.print( i/10+""); //here is the missing code } Oi- Oi -= 10; i++; O i += 10; QUESTION 27 How many syntax errors in the following code that prints out 1 2 3 4 5 int i = 1; while [1 = ) { System.out.print +""); i } QUES Question Completion Status: Which value of grade could stop the while loop? import java.util.Scanner; public class Guess { public static void main(String[] args) { int secret = (int) (Math.random() * 60 - 1); Scanner keyboard = new Scanner(System.in); int grade, sum = 0, count = 0; System.out.println("Enter grade"); grade = keyboard.nextInt(); while (grade != secret) { // secret is sential value sum += grade; count++; System.out.println("Enter grade"); grade = keyboard.nextInt(); } double average = sum / (double) count; System.out.println("average grade is " + average + " with " + count + " students"); } } 45 -3 99 Click Save and Submit to save and submit. Click Save All Answers to save all ans 81 QUESTION 30 Complete the code to print out -1 -2-3-4-5: i = -1; -5) { System.out.printl +"")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
