Question
A Java program that reads the file input.txt and calculates and prints the average of all integer numbers in this file. SAMPLE OUTPUT: throws FileNotFoundException
A Java program that reads the file "input.txt" and calculates and prints the average of all integer numbers in this file.
SAMPLE OUTPUT:
throws FileNotFoundException | try/catch |
OUTPUT SAMPLE #1 for input.txt: 1 2 3 4 5 6 x x x 8 12 x x 34 x x 10 20 OUTPUT SAMPLE #2 for input.txt: xxxxx x x x x xx x x x x x | OUTPUT SAMPLE #1 for input.txt: 1 2 3 4 5 6 x x x 8 12 x x 34 x x 10 20 OUTPUT SAMPLE #2 for input.txt: 1 2 3 4 5 6 x x x 8 12 x x 34 x x 10 20 OUTPUT SAMPLE #3 for input.txt: xxxxx x x x x xx x x x x x |
2. A Java program that reads the file "input.txt" and writes all even values from this file into a new file called "output.txt."
SAMPLE OUTPUT:
throws FileNotFoundException | try/catch |
OUTPUT SAMPLE #1 for input.txt: xx x xx 10 12 1 3 5 34 x 2 5 7 9 x x 44 OUTPUT SAMPLE #2 for input.txt: xx xx xx x x x xxx xxx | OUTPUT SAMPLE #1: OUTPUT SAMPLE #2 for input.txt: xx x xx 10 12 1 3 5 34 x 2 5 7 9 x x 44 OUTPUT SAMPLE #3 for input.txt: xx xx xx x x xxx x xx x x 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