All pastes #628085 Raw Edit

Something

public text v1 · immutable
·published 2007-07-20 18:43 UTC
rendered paste body
#include <iostream.h>

class Employee
{
      public:
      int getAge();
      int setAge(int age);
      int setService(int service);
      int getService();
      float getPay();
      float getHours();
      float setHours(float hrs);
      float setPay(float payc);
      float payCalc();
      private:
      int privage;
      float hours;
      int serviceYears;
      float payRate;
};
float Employee::getHours()
{
      return hours;
}
float Employee::setHours(float hrs)
{
     hours=hrs;
} 
float Employee::payCalc()
{     return hours * payRate;
}
int Employee::getService()
{
    return serviceYears;
}
int Employee::setService(int service)
{
    serviceYears=service;
}
int Employee::getAge()
{
    return privage;
}

int Employee::setAge(int age)
{
    privage=age;
}

float Employee::setPay(float payc)
{
      payRate=payc;
}
float Employee::getPay()
{
      return payRate;
}
      
int main() 
{
    Employee justin;
    cout << "How many hours have you worked?" << endl;
    cout << "---------------------------------" << endl;
    cin >> justin.setHours(float);
    cout << " hours total." << endl;
    justin.setAge(19);
    justin.setPay(12.50);
    justin.setService(3);
    cout << "-------------------------------" << endl;
    cout << "You worked " << justin.getHours() << " hours at a Pay Rate of " << justin.getPay() << " an hour making " << justin.payCalc() << endl;
    return 0;
}