Write a java program that reads inputs from input.txt and writes the output into output.txt. The program should write the average of the numbers read from each line of input.txt into output.txt. Catch all checked exceptions. Example: input.txt contains the numbers below: 5 10 15 20 output.txt should contain: 12.5

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter14: Exception Handling
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
  1. Write a java program that reads inputs from input.txt and writes the output into output.txt.
  2. The program should write the average of the numbers read from each line of input.txt into output.txt.
  3. Catch all checked exceptions.


Example:
input.txt contains the numbers below:
5
10
15
20

output.txt should contain:
12.5

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning