A medical centre uses objects of the class Appointment to record treatments given and medication prescribed during each doctor's appointment. Some of the attributes required in the class are listed in the table. Attribute | Data type | Description DateSeen | DATE | date of treatment Treatments | STRING | treatments given Medications | STRING | medications prescribed Patients are identified by a unique 8-digit number, beginning with the patient's year of birth, for example, 20108989. Doctors are identified by their name, for example, A N Other. [Figure with partial class diagram for 'Appointment']
- (a)Complete the class diagram for Appointment, to include: • attribute and data type for the identification of the patient • attribute and data type for the identification of the doctor • methods to assign date seen, treatments given and medications prescribed • method to return the date seen and the attributes for the patient and the doctor.[5]
- (b)(i)Identify the object-oriented programming (OOP) feature whose function includes restricting external access to the data.[1]
- (b)(ii)Describe what is meant by the OOP feature inheritance.[2]
This question uses a diagram from the original paper, which isn't shown here. Open the full paper from the past papers archive to see it.
Mark scheme
Marking points from the official mark scheme (May/June 2025). The mark or mark type is shown in brackets.
- [1] Two correct attributes (PatientID : INTEGER and Doctor : STRING)
- [1] SetTreatments (...) and SetMedications (...) seen
- [1] and appropriate parameters, with string data types
- [1] GetPatientID() and GetDoctor() seen
- [1] SetDateSeen (...) and GetDateSeen fully correct with appropriate parameter and correct data type in setter.
- [1] Encapsulation
- [1] Inheritance is where a derived class takes properties / behaviours attributes / methods
- [1] ... of a parent / super class / base class
- [1] The attributes / methods / properties taken from the parent / super class / base class can also be extended / copied / used / changed / overwritten / overridden in the subclass.
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 →