SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 6 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 20 Nov 2017 My Price 10.00

Employee::Employee(string theName, float thePayRate)

Help me finish this assignment and also need to write the muddiest point during the programing

  • /*
     * File: employee.h
     * Employee class definition.
     */

    #ifndef _EMPLOYEE_H
    #define _EMPLOYEE_H

    #include <string>
    using namespace std;

    class Employee {
    public:
      Employee(string theName, float thePayRate);

      string getName() const;
      float getPayRate() const;

      float pay(float hoursWorked) const;

    protected:
      string name;
      float payRate;
    };

    /*
     * Employee method definitions.
     */

    Employee::Employee(string theName, float thePayRate)
    {
      name = theName;
      payRate = thePayRate;
    }

    string Employee::getName() const
    {
      return name;
    }

    float Employee::getPayRate() const
    {
      return payRate;
    }

    float Employee::pay(float hoursWorked) const
    {
      return hoursWorked * payRate;
    }


    #endif /* not defined _EMPLOYEE_H */
    /*
     * File: Empltest.cpp
     * This program illustrates the creation and use of employee objects.
     */

    #include <iostream>
    #include "Employee.h"
    #include "Manager.h"
    #include "Supervisor.h"
    using namespace std;


    int main()
    {
      Employee empl("John", 25.0);
      Manager mgr("Matthew", 1200.0, true);
      Supervisor sup("Denise", 780.0, "Accounting");
    // Assume all employees worked 40 hours this period.

      cout << "For Employee:" << endl;
      cout << "Name: " << empl.getName() << endl;
      cout << "Pay: " << empl.pay(40.0) << endl;


      cout << "Changing the Employee's name..." << endl;
      empl.setName("Doug");
      cout << "New Name: " << empl.getName() << endl;


      cout << endl;
      cout << "For Manager:" << endl;
      cout << "Name: " << mgr.getName() << endl;
      cout << "Salaried: " << mgr.getSalaried() << endl;
      cout << "Pay: " << mgr.pay(40.0) << endl;


      cout << "Changing the Manager's salaried status..." << endl;
      mgr.setSalaried(false);
      cout << "New Pay: " << mgr.pay(40.0) << endl;

      cout << endl;  
     

      cout << "For Supervisor:" << endl;
      cout << "Name: " << sup.getName() << endl;
      cout << "Pay: " << sup.pay(40.0) << endl;
      cout << "Dept: " << sup.getDept() << endl;

      cout << "Changing the Supervisor's pay rate..." << endl;
      sup.setPayRate(900.0);
      cout << "New Pay: " << sup.pay(40.0) << endl;

      return 0;
    }//File: manager.h
    //Manager class definition.



    #ifndef _MANAGER_H
    #define _MANAGER_H

    #include "employee.h"

    class Manager : public Employee {
    public:
      Manager(string theName,
              float thePayRate,
              bool isSalaried);

      bool getSalaried() const;

      float pay(float hoursWorked) const;

    protected:
      bool salaried;
    };


    //Manager method definitions.
     


    Manager::Manager(string theName,
                     float thePayRate,
                     bool isSalaried)
      : Employee(theName, thePayRate)
    {
      salaried = isSalaried;
    }

    bool Manager::getSalaried() const
    {
      return salaried;
    }

    float Manager::pay(float hoursWorked) const
    {
      if (salaried)
        return payRate;
      // else
      return Employee::pay(hoursWorked);
    }



    #endif // not defined _MANAGER_H





Attachments:

Answers

(5)
Status NEW Posted 20 Nov 2017 02:11 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)