Consider an input text file that contains two dollar amounts on each line. (The first line of the file will denote how many test cases are to follow).
Input File:
3
45.789 22.5
1.00 -6.767
5. 1000009.00
When you create this input file, make sure that there is only a single space that separates the two numbers on each line of data.
Your program must read each line, add the two values together and generate an output file that contains the original values and their sums using the format shown. The numbers should be expressed as dollar amounts with two decimal places. The numbers should all be aligned underneath each other. The third column should represent the sums of the two numbers in the first two columns. Numbers larger than 3 digits should have commas inserted as shown.
Output File:
$ 45.79 $ 22.50 $ 68.29
$ 1.00 $ -6.77 $ -5.77
$ 5.00 $1,000,009.00 $1,000,014.00