I'm having trouble with doing this function. I just can't figure out how to get this function working?!
Code:#include <iostream.h> // cin, cout, endl #include <conio.h> // getch(), clrscr() #include <string.h> // strncmpi(....) struct jobStruct { float hourlyRate; float regHours; float overtimeBonusRate; }; jobStruct JobFactors(char jobClass[]); int LastDigit(char jobClass[]); int main(void) { char job[6]; jobStruct payData; cout << "Enter job class: "; cin >> job; payData = JobFactors(job); cout << endl << "Hourly rate of pay: " << payData.hourlyRate << endl << "Regular hours: " << payData.regHours << endl << "Overtime bonus rate: " << payData.overtimeBonusRate << endl; cout << endl << endl << " (hit any key when done)"; getch(); return 0; } jobStruct JobFactors(char jobClass[]) { static const float REG_HOURS_ML = 44; static const float BONUS_ML = 0.40; static const float REG_HOURS_MACH = 40; static const float BONUS_MACH = 0.50; static const float REG_HOURS_TLS = 38; static const float BONUS_TLS = 0.50; static const float REG_HOURS_TAC = 42; static const float BONUS_TAC = 0.55; static const float HOURLY_RATE_ML[10] = { 0.00, 8.25, 8.85, 9.50,10.05,10.65,11.40, 0.00, 0.00, 0.00}; static const float HOURLY_RATE_MACH[10] = { 0.00, 9.15, 9.90,10.65,11.40,12.20, 0.00, 0.00, 0.00, 0.00}; static const float HOURLY_RATE_TLS[10] = { 0.00, 7.50, 7.95, 8.40, 8.85, 9.30, 9.70,10.05,10.35, 0.00}; static const float HOURLY_RATE_TAC[10] = { 0.00,10.15,10.85,11.50,12.05,13.00, 0.00, 0.00, 0.00, 0.00}; }
Code tags next time, please. Hammer.



LinkBack URL
About LinkBacks


