I've got one excercise in java to do, and I got stuck. Short description of the problem: I've got to write a code that will be responsible for scheduling patients to the docctors (depending on doctor's specialization) in the clinic. My idea for now is to write at least 5 classes (one for doctor, one for patient, one for schedule, one for specialization and one main class where other classes will be executed). Until now i have code for two classes - doctor and patient (code structure below), but I have no idea how to write code for schedule that will work as follow: after chosing specialisation the schedule will show first 5 available terms that can be booked. The program will not be interactive with user (doesn't reqire to use scaner, each data will be provided in the code structure). My biggest problem is with this class schedule, so if you will help me with it I will be very happy :)
public class Patient {
private String name;
private String lastName;
private String ID;
public Patient (String name, String lastName, String ID) {
this.name = name;
this.lastName = lastName;
this.ID = ID;
}
public String getname() {
return name;
}
public String getlastName() {
return lastName;
}
public String getID() {
return ID;
}
@Override
public String toString(){
return "Patient name: " + name + " " + lastName + "ID: " + ID;
}
}
and for doctor:
public class Doctor {
private String name;
private String lastName;
private String specialization;
public Doctor (String name, String lastName, String specialization) {
this.name = name;
this.lastName = lastName;
this.specialization = specialization;
}
public String getname() {
return name;
}
public String getlastName() {
return lastName;
}
public String getspecialization() {
return specialization;
}
@Override
public String toString(){
return "Doctor name: " + name + " " + lastName + "Specialization: " + specialization;
}
}
Comments
Post a Comment