Thread: Can anybody help me!

  1. #1
    scan22ba
    Guest

    Unhappy Can anybody help me!

    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.

  2. #2
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    first things first, add code tags and use descriptive topic names.

  3. #3
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Errrr... your code is very confusing, you need to tell us what it is you want the function to do and what you're errors are. We aren't mind readers!

  4. #4
    Yeah, dude where's the RETURN statements and where's the rest of the function and the other function?

    Your problems are from INCOMPLETE code.
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

Popular pages Recent additions subscribe to a feed