Thread: code Help* Please

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    3

    Question code Help* Please

    Hello~I am having trouble with my homework.
    I could not have them done. Please Please help me with it.
    Thank you all. God bless...


    The question is
    ""Add temporary, administrative, permanent, and other classifications of employees to the hierarchy from the three coding. Implement and test this hierarchy. Test all member functions. A user interface with a menu would be a nice touch for your test program.""


    Here are 3 coding.
    Code:
    "-----------First
    
    //This is the header file employee.h. 
    //This is the interface for the class Employee.
    //This is primarily intended to be used as a base class to derive
    //classes for different kinds of employees.
    #ifndef EMPLOYEE_H
    #define EMPLOYEE_H
    
    #include <string>
    using std::string;
    
    namespace SavitchEmployees
    {
    
    class Employee
    {
    public:
    Employee( );
    Employee(string theName, string theSsn);
    string getName( ) const;
    string getSsn( ) const;
    double getNetPay( ) const;
    void setName(string newName); 
    void setSsn(string newSsn);
    void setNetPay(double newNetPay);
    void printCheck( ) const;
    private:
    string name; 
    string ssn; 
    double netPay;
    };
    
    }//SavitchEmployees
    
    #endif //EMPLOYEE_H
    
    -----------"
    
    "------Second
    //This is the header file hourlyemployee.h. 
    //This is the interface for the class HourlyEmployee.
    #ifndef HOURLYEMPLOYEE_H
    #define HOURLYEMPLOYEE_H
    
    #include <string>
    #include "employee.h"
    
    using std::string;
    
    namespace SavitchEmployees
    {
    
    class HourlyEmployee : public Employee 
    {
    public:
    HourlyEmployee( );
    HourlyEmployee(string theName, string theSsn,
    double theWageRate, double theHours);
    void setRate(double newWageRate);
    double getRate( ) const;
    void setHours(double hoursWorked);
    double getHours( ) const;
    void printCheck( ) ; 
    private:
    double wageRate; 
    double hours;
    };
    
    }//SavitchEmployees
    
    #endif //HOURLYMPLOYEE_H
    
    -----------"
    
    
    
    "---------Third
    //This is the header file salariedemployee.h. 
    //This is the interface for the class SalariedEmployee.
    #ifndef SALARIEDEMPLOYEE_H
    #define SALARIEDEMPLOYEE_H
    
    #include <string>
    #include "employee.h"
    
    using std::string;
    
    namespace SavitchEmployees
    {
    
    class SalariedEmployee : public Employee
    {
    public:
    SalariedEmployee( );
    SalariedEmployee (string theName, string theSsn,
    double theWeeklySalary);
    double getSalary( ) const;
    void setSalary(double newSalary); 
    void printCheck( ); 
    private:
    double salary;//weekly
    };
    
    }//SavitchEmployees
    
    #endif //SALARIEDEMPLOYEE_H
    
    ------"

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    We won't do your homework. If you have problems, then ask questions.
    And indent your code!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extended ASCII Characters in an RTF Control
    By JustMax in forum C Programming
    Replies: 18
    Last Post: 04-03-2009, 08:20 PM
  2. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 07:34 AM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM