International A Level
Information Technology
Unit 2
Object Orientation
A doctor’s surgery wants a system that will allow the input and display of patient details.
• User will input patient details via a form
• The details will be saved into an object
• The form will clear
• The patient details stored in the object will display as an alert box
Add New Patient
Enter Patient ID 12345678 Input form
gathers patient
Enter Last name Meek
details
Enter First name Gill
Enter telephone number +44123456789
Register
When save button is clicked, form clears and alert box displays patient details:
This page says:
The new patient details are Patient ID: 12345678, Last name: Meek, First name: Gill,
Telephone number: +44123456789
• Create a form based on the diagram above
• Create a user defined object type called Patient
• The Patient type should:
o include properties to store the patient details
o include a constructor
o include a method to display the patient details.
• When the user clicks the register button, a function should be called that:
o stores the input from the form in variables
o clears the form
o creates an instance of Patient sending the stored form variables as
parameters
o calls the display method to display the patient details.