And it's due tomorrow! :(

Functions and parameter passing help

Posted 06 November 2006 - 06:53 PM

Hi everyone. I'm a n00bie both to the site and to C++ programming.

I've been working on this programming assignment this past week and I'm just stumped.
Probably something simple and stupid that I missed since I tend to do that and this
past week was rediculously busy (taking 5 classes this semester)

Anyway, here's the contents of the "payroll.txt" file accessed in the following program:

Re: Functions and parameter passing help

Posted 06 November 2006 - 07:54 PM

I copied the text from the command line output. Let me see if it'll post as it looks on the screen:

This program calculates paychecks for each employee.
A text file will be created outside of the program with the information:
name, rate of pay, number of hours worked, and tax percentage to be deducted.
The program will create a report in columnar format showing the employee
name, hourly rate, number of hours worked, tax rate, gross pay, and net pay.
After all employees are processed, totals will be displayed total gross amount
and total net pay.
Payroll Report
Employee Hourly Hours Tax Gross Net
Name Rate Worked Rate Amount Amount
50.85 60.00 35.00 323958709722612380000000000000
0000000000000000000000000000000000.003051.00
Totals3147027465876806800000000000000000000000000000000000000000000000.00-925596
31349317830000000000000000000000000000000000000000000000.00
Press any key to continue . . .

That's basically what it looks like. It doesn't print any of the employee names and only looks like
it prints the last line of data from the file. Also, my math is obviously messed up somewhere. lol

Remember when declaring a local variable (inside {}) such as
double grossPayTotal=0; // ** zero these totals
double netPayTotal=0;
its value is by default undetermined; make such you initialise such variables.