Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 19 TJ06 23. Choose all that are true Scanner in = new Scanner(System.in); while (true) { //loop until break System.out.print(Enter a number: );
Question 19 TJ06 23. Choose all that are true Scanner in = new Scanner(System.in); while (true) { //loop until break System.out.print("Enter a number: "); if (in.hasNextInt() { break://exit loop System.out.println(" is not an int"); if user enters a letter, the program prints" is not an int" and then asks for another number if user enters an int, the programs ends if user enters a double, it never ends if user enters a letter, it never ends none of the other answers is correct it is a runtime error if user enters a double, the program prints" is not an int" and then asks for another number it is a compile error Question 20 TJ06 24. how many numbers would the following code print for (int i=1;i TJ06 27.what is printed by the following code for (int i=1;i TJ06 29. how many numbers would the following piece of code print: for (int x = 1; x
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started