Question: (JAVA) Complete the following program to read integer values from a file called input.txt and write the sum of each pair into a file called

(JAVA)

Complete the following program to read integer values from a file called input.txt and write the sum of each pair into a file called output.txt. For example, given input.txt as: 10 20 30 40

output.txt would contain: 30 70

Note: You may assume that there is always an even number of integers in the input file and you do not have to do any exception handling.

import java.io.PrintWriter; import java.io.File; import java.util.Scanner; import java.io.FileNotFoundException; public class Quiz9 { public static void main (String [] args) throws FileNotFoundException {

// YOUR CODE HERE

} }

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!