(a) A medical clinic uses objects of the class Patient to assign a priority and a doctor to a patient. Some of the attributes required in the class are listed in the table. Attribute | Data type | Description PatientID | STRING | Unique identifier of the patient Name | STRING | Patient's full name, surname first DoctorID | STRING | ID of doctor administering treatment Treatment is prioritised with a numeric scale of 1 to 5. Complete the class diagram for Patient, to include: • attribute and data type for the date of birth • attribute and data type for the priority • methods to assign the patient ID, priority and doctor ID • methods to return the patient ID, patient date of birth and the priority. [Incomplete Class Diagram for Patient]
- (a)A medical clinic uses objects of the class Patient to assign a priority and a doctor to a patient. Some of the attributes required in the class are listed in the table. Attribute | Data type | Description PatientID | STRING | Unique identifier of the patient Name | STRING | Patient's full name, surname first DoctorID | STRING | ID of doctor administering treatment Treatment is prioritised with a numeric scale of 1 to 5. Complete the class diagram for Patient, to include: • attribute and data type for the date of birth • attribute and data type for the priority • methods to assign the patient ID, priority and doctor ID • methods to return the patient ID, patient date of birth and the priority. [Incomplete Class Diagram for Patient][5]
- (b)(i)Identify the object-oriented programming (OOP) term described as 'an occurrence of an object'.[1]
- (b)(ii)Describe what is meant by the OOP term polymorphism.[2]
Mark scheme
Marking points from the official mark scheme (May/June 2025). The mark or mark type is shown in brackets.
- MP1 Two correct attributes (DateOfBirth : Date) and priority with a sensible name and integer data type
- MP2 SetPatientID (...) and SetDoctorID (...) seen
- MP3 and appropriate parameters, with string data types
- MP4 GetPatientID() and GetDateOfBirth() seen
- MP5 Priority setter and getter fully correct with name matching Priority attribute, with appropriate parameter and correct data type.
- PatientID : STRING
- Name : STRING
- DateOfBirth : DATE
- Priority : INTEGER
- DoctorID : STRING
- SetPatientID (PatientNumber : STRING)
- SetName(FullName : STRING)
- SetDateOfBirth(DOB : DATE)
- SetPriority(Urgency : INTEGER)
- SetDoctorID (DocID : STRING)
- GetPatientID()
- GetName()
- GetDateOfBirth()
- GetPriority()
- GetDoctorID()
- Instance // instantiation
- MP1 Polymorphism is when methods with the same name are redefined / behave differently
- MP2 in derived / inherited classes / subclasses
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →