A Java program that reads the file input.txt and calculates and prints the average of all integer
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 | 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 |