Question: IN JAVA 1 import java.util.* ; 20 /** 3 Complete the code as indicated. Google the Java Scanner class to see the available methods 4

IN JAVA

IN JAVA 1 import java.util.* ; 20 /** 3 Complete the code

1 import java.util.* ; 20 /** 3 Complete the code as indicated. Google the Java Scanner class to see the available methods 4 */ 5 public class InputTester 6 { 70 public static void main(String[] args) 8 { 9 Scanner scanner = new Scanner("5 3.1415 Hello World 19 more words") ; 10 1/ --Start below here. To do: approximate lines of code = 4 11 // 1. read an integer from the scanner into variable i 12 13 7/2. read a double into variable x 14 15 //3. read a word into variable word 16 17 //4. read the rest of the words into variable line 18 19 // -End here. Please do not remove this comment. Reminder: no changes outside the todo regions. 20 System.out.println("Integer read: + i + Expected: 5") ; 21 System.out.println("Double read: " + x + Expected: 3.1415") ; 22 System.out.println("Word read: " + word + Expected: Hello") ; 23 System.out.println("Line read: + line + Expected: World 19 more words"); 24 System.out.println("Checking types: i/2 + x/x = " + (i/i + x/x)) ; 25 } 26 }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!