logo

Object Oriented Programming Using Java

   

Added on  2022-11-28

34 Pages1938 Words266 Views
 | 
 | 
 | 
Running Head: OBJECT ORIENTED PROGRAMMING USING JAVA
OBJECT ORIENTED PROGRAMMING USING JAVA
Name of the Student:
Name of the University:
Author Note:
Object Oriented Programming Using Java_1

OBJECT ORIENTED PROGRAMMING USING JAVA1
Table of Contents
1. Design and development..............................................................................................................3
1.1 Patient class...........................................................................................................................3
1.2 Doctor Class...........................................................................................................................7
1.3 Book appointment class.........................................................................................................8
1.4 Main method........................................................................................................................15
1.4 Menu....................................................................................................................................16
2. Test............................................................................................................................................17
2.1 Initial Test............................................................................................................................17
Outputs generated..........................................................................................................................25
Main menu.................................................................................................................................25
Register new patient..................................................................................................................25
Remove a patient from the list...................................................................................................26
Showing the list of patient after the removal of one patient......................................................26
Book an appointment.................................................................................................................27
Cancel an appointment..............................................................................................................28
Updating one appointment.........................................................................................................29
Management report output.........................................................................................................30
Conclusion.....................................................................................................................................30
References......................................................................................................................................32
Object Oriented Programming Using Java_2

OBJECT ORIENTED PROGRAMMING USING JAVA2
Object Oriented Programming Using Java_3

OBJECT ORIENTED PROGRAMMING USING JAVA3
1. Design and development
The programming language model that is based upon and organized using objects and
data and not on the logic or the functions is known as the Object Oriented Programming or OOP
(Liang and Tsai 2013). For this assignment, Java programming language is used which is a very
popular object oriented programming language. A real life example of an object can be a human
being, with properties like the name, age and address. In computer programs a widget is an
example of an object. In this report, a patient management system is made using Java
programming language, for the GP Surgery. Description of the classes and other methods that are
used are briefly described in this report.
1.1 Patient class
Object Oriented Programming Using Java_4

OBJECT ORIENTED PROGRAMMING USING JAVA4
In the patient class it contains properties like the fname, which denotes the first name of
the patient, lname which denotes the last name of the patient, email contains the email ID of the
patient, the address will hold the address of the patient, the phone will contain the phone number
for the patient, the disease property will store the disease that the patient is looking to cure and
lastly, the patientID will hold the unique Id for each patient.
Some additional methods are also used within the patient class
Method newPatient
This method is used to add new patient to the GP list. The values are entered by the user and
stored in the array list.
Method removePatient
Object Oriented Programming Using Java_5

OBJECT ORIENTED PROGRAMMING USING JAVA5
This method is used to delete or remove patient from the GP list. This method when called
searches for the patient ID to be deleted and when the user enters the ID it runs into the for loop
to check for the patient ID and then when found, it simply removes the ID.
Method viewPatientProfile
Object Oriented Programming Using Java_6

OBJECT ORIENTED PROGRAMMING USING JAVA6
The aim of using this method is to display the details of the patient using a particular patient ID.
By using this method the two things can be done. One it shows the full list of the patients in the
array list and the second one the user can manually search for the patient and get the details
displayed on the interface.
Method view
This method will show the entire list of patients that are registered to the GP Surgery list.
Object Oriented Programming Using Java_7

OBJECT ORIENTED PROGRAMMING USING JAVA7
1.2 Doctor Class
The doctor class contains the properties like the name, speciality, time, doctorID and fee which
will contain the name of the doctor, what the doctor specializes in, visiting time of the doctor, the
unique doctor Id and the fees of the doctor respectively. The doctor class also contains a method
which is named as viewDoctors.
Method viewDoctors
Object Oriented Programming Using Java_8

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents