Please help me!!! Does it have the right default constructors? Please check it... #include using namespace st

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Please help me!!! Does it have the right default constructors? Please check it... #include using namespace st

Post by answerhappygod »

Please help me!!! Does it have the right default
constructors? Please check it...
#include <iostream>
using namespace std;
class Doctor {
private:
string doctorId;
string telephoneNumber;
public:
Doctor();
Doctor(string name, string doctorId,
string telephoneNumber);
void setName(string name);
void setDoctorId(string
doctorId);
void setTelephoneNumber(string
telephoneNumber);
string getName();
string getDoctorId();
string getTelephoneNumber();
};
Doctor::Doctor() {
}
Doctor::Doctor(string name, string doctorId, string
telephoneNumber) {
Doctor::name = name;
Doctor::doctorId = doctorId;
Doctor::telephoneNumber = telephoneNumber;
}
void Doctor::setName(string name) {
Doctor::name = name;
}
void Doctor::setDoctorId(string doctorId) {
Doctor::doctorId = doctorId;
}
void Doctor::setTelephoneNumber(string telephoneNumber) {
Doctor::telephoneNumber = telephoneNumber;
}
string Doctor::getName() {
return Doctor::name;
}
string Doctor::getDoctorId() {
return Doctor::doctorId;
}
string Doctor::getTelephoneNumber() {
return Doctor::telephoneNumber;
}
class Patient {
private:
string name;
int wardNumber;
double fee;
string doctorId;
public:
Patient();
Patient(string name, int wardNumber,
double fee, string doctorId);
void setName(string name);
void setWardNumber(int
wardNumber);
void setFee(double fee);
void setDoctorId(string
doctorId);
string getName();
int getWardNumber();
double getFee();
string getDoctorId();
};
Patient::Patient() {
}
Patient::Patient(string name, int wardNumber, double fee, string
doctorId) {
Patient::name = name;
Patient::wardNumber = wardNumber;
Patient::fee = fee;
Patient::doctorId = doctorId;
}
void Patient::setName(string name) {
Patient::name = name;
}
void Patient::setWardNumber(int wardNumber) {
Patient::wardNumber = wardNumber;
}
void Patient::setFee(double fee) {
Patient::fee = fee;
}
void Patient::setDoctorId(string doctorId) {
Patient::doctorId = doctorId;
}
string Patient::getName() {
return Patient::name;
}
int Patient::getWardNumber() {
return Patient::wardNumber;
}
double Patient::getFee() {
return Patient::fee;
}
string Patient::getDoctorId() {
return Patient::doctorId;
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply