Salary,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
void calcWeeklyPay(double empData[][COLS], const int count)
{
double wage;
double hour;
int row;
for (row = 0 ; row < count; row++);
{
hour = empData[row][0];
wage = empData[row][1];
double weeklyPay;
weeklyPay = hour * wage;
if (hour > 40)
{
int overtimePay = 0;
int overTimeHour = hour - 40;
overtimePay = overTimeHour * (wage*1.5);
empData[row][2] = 40 * wage + overtimePay;
}
else {
empData[row][2] = weeklyPay;
cout << weeklyPay;
}
}
}
//
//
//
void printAllEmployees(const string names[], const double empData[][COLS], const int count)
{
cout << "\t" << "Employee Financial Report" << endl;
cout << "\n";
cout << "\t" << "Employee" << " Wages" << "\t" << "Hours" << "\t" << "Salary";
cout << "\n";
cout << "\n";
// fill in
for (int i = 0; i < count; i++)
{
cout<< "\t" << names[i] << "\t";
for (int n = 0; n < COLS; n++)
{
cout << empData[i][n] << "\t";
}
cout << endl;
}
}
//
}
|
I'm really stuck on this problem...
Why is it in my salary column all it outputs its 0? How would i fix this ?
Last edited on
Line 103 for (row = 0 ; row < count; row++);
you don't need the ';' after the for loop
omg...thank you so much...
Topic archived. No new replies allowed.