Question: For this lab you will write 2 programs, given below [DNote: you must write 2 versions one that throws the RileNotEoundRxceetion exception and one that

 For this lab you will write 2 programs, given below [DNote:

For this lab you will write 2 programs, given below [DNote: you must write 2 versions one that throws the RileNotEoundRxceetion exception and one that handles the exception (try/catch)]. Also, make sure that your programs handle (consume) unwanted input Your programs should produce the expected output listed below First, create a file called "input.txt" that contains a sequence of integer values separated by one or more spaces or returns. You can use the Notepad to create the file. When you save the program choose the "text file" option and name your file "input" because Notepad will automatically append the extension.txt". Put this file in the folder you are going to use for the following Java programs (anyway, know where your text file is located, so that you can give a full path in case it isn't in the same folder as your Java program). You will use this file in the programs below. 1. Write a Java program that reads the file "input.txt" and calculates and prints the average of all integer numbers in this file. Expected OUTPUT: throws FileNet try/catch OUTPUT #1 for input.txt : 1 2 3 4 5 OUTPUT #1 for input.txt. 1 2 3 4 16 x 8 12 x 34 x 10 20 Number 1 is: 1 Number 2 is: 2 |Number # 3 is: 3 Number # 4 is: 4 |Number 5 is: 5 Number # 6 is: 6 Number # 7 is: 8 Number # B is: 12 |Number # 9 is: 34 Number # 10 is: 10 Number # 11 is: 20 The average of 11 numbers/fileThe average of 11 numbers/file Number # 1 is: 1 Number # 2 is: 2 Number # 3 is: 3 Number # 4 is: 4 Number # 5 is: 5 Number # 6 is: 6 Number # 7 is: 8 ber # 8 is: 12 umber # 9 is: 34 Number # 10 is: 10 Number # 11 is: 20

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!