Ejemplo n.º 1
0
Doctor::Doctor(const Doctor & rhs):speciality(rhs.speciality), visitFee(rhs.visitFee)
{
    setSalary(rhs.getSalary());
    setName(rhs.getName());
    setSsn(rhs.getSsn());
    setNetPay(rhs.getNetPay());
}
Ejemplo n.º 2
0
// Assignment operator uses Set methods to centralize
// the memory management work.
Student &Student::operator=(const Student &rhs)
{
    setAge(rhs.mAge);
    setLast(rhs.mLastName);
    setFirst(rhs.mFirstName);
    setEmail(rhs.mEmail);
    setSsn(rhs.mSocial);
    return *this;
}
Ejemplo n.º 3
0
Doctor & Doctor::operator=(const Doctor & rhs)
{
    if (this == &rhs)
        return *this;
    else
    {
        speciality = rhs.speciality;
        visitFee = rhs.visitFee;
        setSalary(rhs.getSalary());
        setName(rhs.getName());
        setSsn(rhs.getSsn());
        setNetPay(rhs.getNetPay());
        return *this;
    }
}
Ejemplo n.º 4
0
Student::Student(
    const int age,
    const char *last_name,
    const char *first_name,
    const char *email,
    const char social[])
    : mAge(0),
    mLastName(0),
    mFirstName(0),
    mEmail(0)
{
    mSocial[0] = 0;

    setAge(age);
    setLast(last_name);
    setFirst(first_name);
    setEmail(email);
    setSsn(social);
}