Enter the name and location of the input file:
/Users/MJ/Desktop/incomes.txt
Enter the name and location of the output file: /Users/MJ/Desktop/incomfdfdf.txt
Miss Informed 125432 32560
Sweet Tooth 5432 9500
Bad Data 1255 -4500
John Smith 1225 3500
Nancy Brown 1555 154500
Name ID Gross Income Taxes Net Income
=====================================================================
Nancy Brown 1555 $154500.00 $41570.00 $112930.00
Sample file
Miss Informed
125432 32560.0
Sweet Tooth
5432 9500
Bad Data
1255 -4500.0
John Smith
1225 3500.0
Nancy Brown
1555 154500.00
I am required to use while(!fin.eof())
I tried your suggestion and it didn't work with me but I understand why you didn't use eof but I am required to use it
You have the variables to store the information for one record. You read all records (into the same set of variables,) and only process the last one (which is the last to occupy the set of variables.) Change how you do things.