Coursework 2: Java OOP Implementation in GP Surgery Management System
VerifiedAdded on 2025/04/28
|9
|1055
|241
AI Summary
Desklib provides past papers and solved assignments for students. This report analyzes object-oriented programming in Java.

COURSEWORK 2: CRITICAL REPORT
Student name-
Registration number-
Student name-
Registration number-
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Table of Contents
Introduction................................................................................................................................3
Concepts of object oriented programming and use in the program -.........................................3
Approach and program design...................................................................................................4
Conclusion..................................................................................................................................7
REFERENCES...........................................................................................................................8
2
Introduction................................................................................................................................3
Concepts of object oriented programming and use in the program -.........................................3
Approach and program design...................................................................................................4
Conclusion..................................................................................................................................7
REFERENCES...........................................................................................................................8
2

Introduction
GP surgery program is developed by using the Java programming language and its object-
oriented concepts. This java application consists of a user interface which allows them to
manage their details in a hospital management system. For storing details like name, age,
email, etc. of patients as well as doctors. The user can choose many options like seeing
patient’s details, change appointment time, etc. so that they can store and manage their
information.
Concepts of object-oriented programming and use in the program -
For any Java-based program, knowledge about OOP concepts is must, as in order to run the
program continuously, we must have various objects and classes to store values and methods.
The following OOP’s concepts are used on this java program.
Classes: Classes are like the category that contains various objects as items. For example, if
our class is birds then its objects are crow, sparrow, hen, etc. So, in terms of programming
classes stores objects of similar types. Like strings, integer, enum, etc. Various classes can be
created using OOP’s concept. There are three main classes in GP Armstrong surgery and they
are as follows:
1. Main class: This class will have all the object which we will be used for taking input
from the user. Each input statement will have separate methods, which will be
declared in this class too.
2. Doctor class: TreeMap will be used in this class to store doctor’s information and
their respective appointment details. This treemap will be called in the main class so
that the user can verify doctors with their respective appointments.
3. Patient class: The patient class contains all the objects and methods that are required
to add/update/delete the patients or their appointments from the database. It also
contains other functions related to patients.
Objects: According to the concepts of Object-oriented programming various types of objects
can be created. Objects can be used to call any method from any class as long as the class is
declared an object is made. When an object is created in a class memory is allocated to the
class after initialization. For this java program, multiple objects are created so that methods
can be called at various instances in both patient and doctor class. Example:
patientObject.addNewPatient();
Patients objPatient = new Patients(fName, lName, email, mobile,
date_of_birth, address, id, paidFee, membership); //Calling constructor to
set values.
//adding the patient to the patient list
3
GP surgery program is developed by using the Java programming language and its object-
oriented concepts. This java application consists of a user interface which allows them to
manage their details in a hospital management system. For storing details like name, age,
email, etc. of patients as well as doctors. The user can choose many options like seeing
patient’s details, change appointment time, etc. so that they can store and manage their
information.
Concepts of object-oriented programming and use in the program -
For any Java-based program, knowledge about OOP concepts is must, as in order to run the
program continuously, we must have various objects and classes to store values and methods.
The following OOP’s concepts are used on this java program.
Classes: Classes are like the category that contains various objects as items. For example, if
our class is birds then its objects are crow, sparrow, hen, etc. So, in terms of programming
classes stores objects of similar types. Like strings, integer, enum, etc. Various classes can be
created using OOP’s concept. There are three main classes in GP Armstrong surgery and they
are as follows:
1. Main class: This class will have all the object which we will be used for taking input
from the user. Each input statement will have separate methods, which will be
declared in this class too.
2. Doctor class: TreeMap will be used in this class to store doctor’s information and
their respective appointment details. This treemap will be called in the main class so
that the user can verify doctors with their respective appointments.
3. Patient class: The patient class contains all the objects and methods that are required
to add/update/delete the patients or their appointments from the database. It also
contains other functions related to patients.
Objects: According to the concepts of Object-oriented programming various types of objects
can be created. Objects can be used to call any method from any class as long as the class is
declared an object is made. When an object is created in a class memory is allocated to the
class after initialization. For this java program, multiple objects are created so that methods
can be called at various instances in both patient and doctor class. Example:
patientObject.addNewPatient();
Patients objPatient = new Patients(fName, lName, email, mobile,
date_of_birth, address, id, paidFee, membership); //Calling constructor to
set values.
//adding the patient to the patient list
3
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

patients.add(objPatient);
Here, an object of type patient has been created to access the method addPatient() from the
patient class.
Constructor: Constructor is the kind of methods which have the same name as the class and
it initializes an object to use at any instance required. Constructors have various statements
just like any other method. When an object is created by the use of new() keyword, then the
constructor is called to initialize its object and an initial value is assigned to that object. For
this problem, we have to pass various parameters like name, email, contact in the method so
that patients can be verified before moving any further. Doctor class will also have a
constructor which will verify the doctor’s details before making any appointments.
public Patients(String fName, String lName, String email, String contact,
String dob, String patientAddress, int id, int paidFees, String membership)
{
//assigning the name
this.fName = fName;
//assigning the email
this.email = email;
//assign date of birth
this.dob = dob;
//assign surname
this.lName = lName;
//assign the contact number
this.contact = contact;
//assigning the address
this.patientAddress = patientAddress;
//assigning the patient id
this.id = id;
//assigning the paid fees
this.paidFees = paidFees;
//assigning the type of membership
this.membership = membership;
}
This Keyword: In Java, this is a special keyword which is used to refer to the current object.
By using this keyword we tend to reduce errors in code due to the naming of variables. In the
above example of constructors, we can see that this keyword is used for each variable that is
created. It actually assigns the passed value to the globally declared variable Example:
In the patient class, variable by the name ‘fName’ is created and in the Patient constructor
‘fName’ is being passed. Now, this.fName actually assigns the passed value in the
constructor call to the globally declared fName variable.
Approach and program design
4
Here, an object of type patient has been created to access the method addPatient() from the
patient class.
Constructor: Constructor is the kind of methods which have the same name as the class and
it initializes an object to use at any instance required. Constructors have various statements
just like any other method. When an object is created by the use of new() keyword, then the
constructor is called to initialize its object and an initial value is assigned to that object. For
this problem, we have to pass various parameters like name, email, contact in the method so
that patients can be verified before moving any further. Doctor class will also have a
constructor which will verify the doctor’s details before making any appointments.
public Patients(String fName, String lName, String email, String contact,
String dob, String patientAddress, int id, int paidFees, String membership)
{
//assigning the name
this.fName = fName;
//assigning the email
this.email = email;
//assign date of birth
this.dob = dob;
//assign surname
this.lName = lName;
//assign the contact number
this.contact = contact;
//assigning the address
this.patientAddress = patientAddress;
//assigning the patient id
this.id = id;
//assigning the paid fees
this.paidFees = paidFees;
//assigning the type of membership
this.membership = membership;
}
This Keyword: In Java, this is a special keyword which is used to refer to the current object.
By using this keyword we tend to reduce errors in code due to the naming of variables. In the
above example of constructors, we can see that this keyword is used for each variable that is
created. It actually assigns the passed value to the globally declared variable Example:
In the patient class, variable by the name ‘fName’ is created and in the Patient constructor
‘fName’ is being passed. Now, this.fName actually assigns the passed value in the
constructor call to the globally declared fName variable.
Approach and program design
4
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

 For this java program, the concept of ArrayList is used to store patient and doctor
details which are accessed by calling the method of that patient class using the
respective objectives. The reason for using ArrayList is that this datatype doesn’t
require any array size beforehand to store information due to its dynamic type.
 TreeMaps are similar to ArrayList but TreeMap contains key-value pair which means
we can access any value if we have its respective key.
 All the requirements were completed using basic concepts of object-oriented
programming but a much better user interface can be created with the help of
advanced java concepts
 Concepts like exception handling, hashmap, hashtable can be introduced to make this
program much more reliable on the data storage side.
 Below are some snippets of the application.
5
details which are accessed by calling the method of that patient class using the
respective objectives. The reason for using ArrayList is that this datatype doesn’t
require any array size beforehand to store information due to its dynamic type.
 TreeMaps are similar to ArrayList but TreeMap contains key-value pair which means
we can access any value if we have its respective key.
 All the requirements were completed using basic concepts of object-oriented
programming but a much better user interface can be created with the help of
advanced java concepts
 Concepts like exception handling, hashmap, hashtable can be introduced to make this
program much more reliable on the data storage side.
 Below are some snippets of the application.
5

}
Figure 1: Main class of the program
Figure 2: Main menu of the program
6
Figure 1: Main class of the program
Figure 2: Main menu of the program
6
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Figure 3: Patient class of the program
7
7
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Conclusion
All the assessment requirements were fulfilled by basic java OOP’s concepts. Using
advanced concepts like Exception handling, HashMap, Hash Table can improve the
program's efficiency in the future. Various programming techniques were used in the
implementation of this java program. Learning outcome included OOP’s concepts, using
classes with objects and package importing.
8
All the assessment requirements were fulfilled by basic java OOP’s concepts. Using
advanced concepts like Exception handling, HashMap, Hash Table can improve the
program's efficiency in the future. Various programming techniques were used in the
implementation of this java program. Learning outcome included OOP’s concepts, using
classes with objects and package importing.
8

References
Rana, K., 2016. Java Programming.
Ebert, F., Castor, F. and Serebrenik, A., 2015. An exploratory study on exception
handling bugs in Java programs. Journal of Systems and Software, 106, pp.82-101.
Nakshatri, S., Hegde, M. and Thandra, S., 2016, May. Analysis of exception handling
patterns in Java projects: An empirical study. In Proceedings of the 13th International
Conference on Mining Software Repositories (pp. 500-503). ACM.
Sebesta, R.W., 2012. Concepts of programming languages. Boston: Pearson,.
Liang, Y.D. and Tsai, M.J., 2013. Introduction to Java programming: brief version.
Pearson.
9
Rana, K., 2016. Java Programming.
Ebert, F., Castor, F. and Serebrenik, A., 2015. An exploratory study on exception
handling bugs in Java programs. Journal of Systems and Software, 106, pp.82-101.
Nakshatri, S., Hegde, M. and Thandra, S., 2016, May. Analysis of exception handling
patterns in Java projects: An empirical study. In Proceedings of the 13th International
Conference on Mining Software Repositories (pp. 500-503). ACM.
Sebesta, R.W., 2012. Concepts of programming languages. Boston: Pearson,.
Liang, Y.D. and Tsai, M.J., 2013. Introduction to Java programming: brief version.
Pearson.
9
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 9
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.


