I need help. I wrote this code. It takes information from a txt file and calculates pay, tax, and net pay. However, I cant get it to read more than one line. It only reads the first line! Please help!!
This is the text file
101456 H 20 6.57
100045 S 81994.12
100321 H 45 23.50
101987 H 39 15.76
100486 S 116935.65
100357 H 50 18.19
102003 H 30 12.75
123887 S 226345.43
110441 S 74783.28
101119 H 35 22.22
114532 S 152573.23
100003 H 40 19.00
101285 H 60 29.95
105539 S 130284.54
176531 S 88546.77
101119 H 38 43.15
You should indent your code better. Then you'd see that // Write Cout statments for user is outside of the loop. This way you process all lines, but the final calculation is only for the last one.