Click here for Assignment 3 Question
Using sytem;

// Class Person
public class Person{
   private:
      string name;   // Name of person
      int dob;          // Date of birth
   public:
      void setName(string aName) { name = aName; }
      string getName() const { return name; }
      void setDob(int date) { dob = date; }
      int getDob() const { return date; }

      // Constructor to initialize and set name and dob
      Person() { ... }
}

// Inherits from class Person
public class DoctorPerson : Person{
   private:
      int dateEmployed;      // Date which the doctor was employed
      string specialSkill;      // Specialization of the doctor
   public:
      void setDateEmployed(int date) { dateEmploeyd = date; }
      int getDateEmployed(() const { return dateEmployed; }
      void setSpecialty(string specialSkill) { specialty = specialSkill; }
      string speciaty() const { return specialty; }

      // Constructor to initialize and set dateEmployed and specialty
      DoctorPerson() {
         super();
         ...
      }
}

// Inherits from class Person
public class PatientPerson : Person{
   private:
      string employer;                //Name of employer
      string insurCo;                  // Name of insurance company
      Treatment treatmentInfo;   // Patient's treatment information
   public:
      void setEmployer(string employerame) { employer = empoyerName; }
      string getEmployer() const { return emploer; }
      void setInsuranceCo(string incurCoName) { insurCo = insurCoName; }
      string getInsuranceCo() const { return insurCo; }

      // Constructor to initialize and set employer and insurCo
      PatientPerson() {
         super();
         treatmentInfo = new Treatment;
         ...
      }

      // Get all treatment information and display to Medical Office Manager
      void getAllTreatments(){
         int treatmentDate = treatmentInfo.getDate();
         int startTime = treatmentInfo.getStartTime();
         int endTime = treatmentInfo.getEndTime();

         Console.WriteLine(treatmentDate);
         Console.WriteLine(startTime);
         Console.WriteLine(endTime);
      }
}

// Class Treatment
class Treatment{
   private:
      int treatmentDate:   // Date of appointment for treatment
      int startTime;         // Start of consultation time
      int endTime;          // End of consultation time
   public:
      void setTreamentDate(int date) { treatmentDate = date; }
      int getTreatmentDate() const { return treatmentDate; }
      void setStartTime(int sTime) { startTime = sTime; }
      int getStartTime() const { return startTime; }
      void setEndTime(int eTime) { endTime = eTime; }
      int getEndTime() const { return endTime; }

      // Constructo to initialize and set treatmentDate, startTime and endTime
      Treatment() { ... }
}

// Function main
public static void main()
{
   Console.WriteLine("XYZ Clinic Database System");
}
Hosted by www.Geocities.ws

1