Assignment #3
Translate
the design structure to code in C#.
Assume
appropriate attributes and services if required.
Solution :
class Person{
private String name;
private DateTime
dob;
public void setName(String s){
name=n;
}
public void setDOB(DateTime d){
dob=d;
}
public String getName(){
return name;
}
public DateTime getDOB(){
return dob;
}
}
class DoctorPerson:Person{
private DateTime
emplDate;
private String speciality;
public DateTime getemplDate(){
return date_emp;
}
public void setemplDate(DateTime d){
date_emp=d;
public String getSpeciality(){
return speciality;
}
public void setSpeciality(String sp){
speciality=sp;
}
}
}
public class PatientPerson:Person{
private String employer;
private String insComp;
private Treatment [] trt;
public String getEmployer(){
return employer;
}
public void setEmployer(String e){
employer=e;
}
public String getinsComp(){
return insComp;
}
public void setinsComp(String ic){
insComp=ic;
}
public Treatment []
getAllTreatments(){
return trt;
}
}
public class Treatment{
private DateTime
date;
private DateTime
start;
private DateTime
end;
public DateTime getTreatmentDate(){
return date;
}
public DateTime getStartTime(){
return start;
}
public DateTime getEndTime(){
return end;
}
}