Question: JAVA - The key is the numbers are read in as INTEGERS, but the numbers must be tpconverted to DOUBLE to perform the calculations. Write

JAVA - The key is the numbers are read in as INTEGERS, but the numbers must be tpconverted to DOUBLE to perform the calculations.  JAVA - The key is the numbers are read in as

Write a complete Java program to do the following a. Read from a file input5.txt a list of pairs of integers. For each pair, if the sum of the two numbers is positive, calculate as a decimal number the first divided by the second. If the sum is negative, calculate as a decimal number the second divided by the first.You may assume neither value is zero. b. Write the two numbers and the calculated quotient to a file outputs.txt, one pair per line. Do this until there is no more data to read. At the end, print 2 things with an appropriate message: The number of pairs processed, and the value of the quotient closest to zero. Remember that the quotient may be positive or negative. c

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!