Time To Code: Task I to Task V
Get hands-on practice by coding a few programming tasks.
đź“Ś Note: Before starting a task, copy the code of the previous tasks.
Task I: Design the basic structure
As previously discussed, a person in a hospital can be a doctor or a patient.
Our task is to create the classes and add the instance variables to represent these two types of people. Read the following specifications carefully.
-
Every patient and doctor has a name.
-
The age of every patient and doctor is recorded.
-
A patient is given an
int
type code every time he/she schedules an appointment. -
A doctor can be a cardiologist, neurosurgeon, or dietitian.
đź’ˇ Hint: Think of a doctor as an interface and all the types of doctors as classes.
-
The status of a doctor’s availability is also recorded. A doctor may or may not ...