Question: 1 2 canners are handy for reading input that is stored in a file. For this exercis e, create a file called calaaal Inumbers.txt that
canners are handy for reading input that is stored in a file. For this exercis e, create a file called calaaal Inumbers.txt" that contains the following data: 1.2 2.3 3.4 4.5 2.0 3.e 4.0 5.0 6.0 7. 8.0 9. Read each line, convert the nymbers in each line to doubles, and print each row of numbers and their totai Start with the code below and complete the getInt method. The method should prompt the user to enter an integer. Scan the input the user types. If the input is not an int, throw an IllegalArgusentException; otherwise, return the int. mport java.util.scanner; public class Throwing public static void main(stringll args) int x get Int )a ystem.out.printIn(x) public static int getint II your code goes here Modify the program from Lab 7.6.1 so that getInt throws an TOException Instead of an IllegalArgumentException. Modify the main program so that it catches and prints the TOExcept ion
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
