HELP on function assignment

I just learned functions in my class and im having a hard time with my code. it just gives me infinite errors in my error file. I also need help on how to count the bad, good, and total records as my code wont work. Thank you everyone :)

Assignment:
read records from the input file ( an input module)
error check the records (can be done in the input module or in a separate module)
count bad records
count good records
count total number of records
bad records should be outputted to an error file
print good records to an output file ( a separate module)
output to the screen number of bad, good, and total number of records processed
thoroughly test your program using an adequate test data

 
(removed)


Input file im reading:

Al Clark 38 45.5 4 M
Joyce Itin 120 77 3 M
Vahid Hamidi 15 25 3 M
Melody Jung 27 60.6 1 M
Joahn Garcia -25 -3 -3 M
Vera Moroz 23 72 3 N
Robert Innes 19.85 40 1 S
Mark Armstrong -25 23 5 M
Ashton Williams 15 15.69 -6 S
Angela Klein 0 54.32 6 S
Jerry Smith 168.5 36.5 2 S
Leslie McHenry 68 95.63 1 S
Morgan Stock 72 99 2 S
Nick Lee 15 5 1 S
Mary Jones 45 75.36 2 S
Last edited on by admin
This has nothing to do with functions.
1
2
3
4
hourlyWageError = hourlyWage <= 0;
hoursWorkedError = hoursWorked <= 0;
ExemError = Exem < 0;
MarStatError = !'M' || !'m' || !'s' || !'S';

You cannot have a variable be equal to a condition. These should all be something like
1
2
3
4
if(hourlyWage <= 0)
{
    hourlyWageError = someDouble;
}
Topic archived. No new replies allowed.