C++ - Individual Assignment
C++ - Individual Assignment
Sri Lanka
Submitted by:
Prasanga Wadanamby (CB003340)
Acknowledgment
I would like to thank Mr.Udesh Amarasinghe for his continuous guidance and support in
carrying out this project. Without his valuable supervision, all my efforts would have been
short sighted. His continuous help encouraged me to involve in the project in a wider scope
and aspect.
I would also thank my family members and my batch colleagues who rendered me their
immense support throughout this project.
Table of Content
Acknowledgment........................................................................................................ 2
List of Figures............................................................................................................ 5
List of Table.............................................................................................................. 6
1.0
Introduction..................................................................................................... 7
List of Figures
List of Table
1.0 Introduction
Each of these main categories contains description and a justification to give the clear idea of
the implemented system.
2.2
Class
Diagram
Class diagram is a design which represents and illustrates the dependencies and connections
of the source code with classes.
Object
Encapsulation
As it mentioned in Exforsys Inc(n.d) Encapsulation is the process of combining all data and
functions into a single object called class which only provides the indirect access to the data
via a function presets for a user.
The below code at figure might give an idea of how a class encapsulate all data and
functions.
Figure 5 - Encapsulation
Figure 6 Validation 1
As it shows in figure 6, user inputs are taken as character values in all menu functions to
prevent inputs with char values for integer values.
Figure 7 Validation 2
Expected Result
Actual Result
Status
Go to Admin Login
Goes to Admin
OK
Login Screen
Press 2 for go to Doctor
screen
Go to Doctor Login
Login screen
Goes to Doctor
OK
Login Screen
Press 3 for go to Nurse
screen
Go to Nurse Login
Login screen
Goes to Nurse Login
OK
Login Screen
Press 4 for go to Patient
screen
Go to Patient Login
screen
Goes to Patient
OK
Login Screen
Press 0 to exit
screen
Close the program
Login screen
Closes the program
OK
Wrong selection
Shows error
OK
message
Table 1 Main Menu Screen
Expected Result
Actual Result
Status
Enter user id
OK
Enter password
OK
Press 0 to exit
Go to Main Menu
OK
screen
User authentication success Go to the relevant
screen
Goes to the relevant
OK
user menu
user menu
OK
Wrong selection
again
Show error message
again
Shows error
OK
message
Table 2 General Login Screen
This prompt will allow the admin to select four main categories which redirect the admin to
sub menus of the given categories.
Test Case
Expected Result
Actual Result
Status
Go to Add User
OK
Screen
Press 2 for go to Update
screen
Go to Update Details
screen
Goes to Update
OK
Details Screen
Press 3 for go to Delete
screen
Go to Delete Details
Details screen
Goes to Delete
OK
Details Screen
Press 4 for go to Search
screen
Go to Search Details
Details screen
Goes to Search
OK
Details Screen
Press 0 to exit
screen
Go to Main Menu
Details screen
Goes to Main Menu
OK
Wrong selection
screen
Show error message
screen
Shows error
OK
message
Table 3- Admin Menu Screen
This prompt will allow the doctor to perform the tasks he/she assigns to perform.
Test Case
Expected Result
Actual Result
Status
Go to Search Assign
Goes to Search
OK
Records
Go to Search Patient
Assign Records
Goes to Search
OK
Patient Screen
Press 3 for go to Add
screen
Go to Add Diagnosis
Patient screen
Goes to Add
OK
Details screen
Diagnosis Details
Go to View
screen
Goes to View
Diagnosis Details
Diagnosis Details
screen
Go to Update
screen
Goes to Update
OK
Diagnosis Details
Go to Delete
Diagnosis Details
Goes to Delete
OK
Diagnosis Details
Go to Main Menu
Diagnosis Details
Goes to Main Menu
OK
Wrong selection
screen
Show error message
screen
Shows error
OK
message
Table 4 Doctor Menu Screen
OK
This prompt will appear when a nurse logs in to the system and it will allow him/her to search
the patient details and assign that patient to doctor.
Test Case
Expected Result
Actual Result
Status
Go to Search Patient
Goes to Search
OK
Patient Screen
Press 1 for go to Search
screen
Go to Search Doctor
Patient screen
Goes to Search
OK
Doctor Screen
Press 3 for go to Add
screen
Go to Add Diagnosis
Doctor screen
Goes to Add
OK
Details screen
Diagnosis Details
OK
OK
Press 0 to exit
Go to Main Menu
screen
Goes to Main Menu
Wrong selection
screen
Show error message
screen
Shows error
message
Expected Result
Actual Result
Status
Go to View
Goes to View
OK
Diagnosis Screen
Press 2 for go to View
Diagnosis screen
Go to View Payments
Diagnosis screen
Goes to View
OK
Payments Screen
Press 0 to exit
screen
Go to Main Menu
Payments screen
Goes to Main Menu
OK
Wrong selection
screen
Show error message
screen
Shows error
OK
message
Table 6 Patient Menu Screen
This prompt will allow the administrator to move in to the sub menus which handles the
insertion of users such as administrators, doctors, nurses and patients.
Test Case
Expected Result
Actual Result
Status
Go to Add Patient
OK
Patient Screen
Press 2 for go to Add
Screen
Go to Add Doctor
Screen
Goes to Add Doctor
OK
Doctor Screen
Press 3 for go to Add
Screen
Go to Add Nurse
Screen
Goes to Add Nurse
OK
Nurse Screen
Press 4 for go to Add
Screen
Go to Add Admin
Screen
Goes to Add Admin
OK
Admin Screen
Press 0 to exit
Screen
Go to Admin Menu
Screen
Goes to Admin
OK
Wrong selection
screen
Show error message
Menu screen
Shows error
OK
message
Table 7 Add User Menu Screen
This prompt will allow the administrator to move in to the sub menus which handles the
update process of patient details, doctor details, diagnosis records and payments records.
Test Case
Expected Result
Actual Result
Status
Go to Update Patient
Goes to Update
OK
Patient Screen
Press 2 for go to Update
Screen
Go to Update Doctor
Patient Screen
Goes to Update
OK
Doctor Screen
Press 3 for go to Update
Screen
Go to Update
Doctor Screen
Goes to Update
OK
Diagnosis Screen
Press 4 for go to Update
Diagnosis Screen
Go to Update
Diagnosis Screen
Goes to Update
OK
Payments Screen
Press 0 to exit
Payments Screen
Go to Admin Menu
Payments Screen
Goes to Admin
OK
Wrong selection
screen
Show error message
Menu screen
Shows error
OK
message
Table 8 Update Details Menu Screen
Expected Result
Actual Result
Status
Go to Delete Patient
Goes to Delete
OK
Patient Screen
Press 2 for go to Delete
Screen
Go to Delete Doctor
Patient Screen
Goes to Delete
OK
Doctor Screen
Press 3 for go to Delete
Screen
Go to Delete Nurse
Doctor Screen
Goes to Delete
OK
Nurse Screen
Screen
Nurse Screen
Go to Delete
Goes to Delete
OK
Diagnosis Screen
Press 5 for go to Delete
Diagnosis Screen
Go to Delete
Diagnosis Screen
Goes to Delete
OK
Payments Screen
Press 0 to exit
Payments Screen
Go to Admin Menu
Payments Screen
Goes to Admin
OK
Wrong selection
screen
Show error message
Menu screen
Shows error
OK
message
Table 9 Delete Details Menu Screen
Search details menu contains the functions of search doctor, diagnosis details and payments
details.
Test Case
Expected Result
Actual Result
Status
Go to Search Doctor
Goes to Search
OK
Doctor Screen
Press 2 for go to Search
Screen
Go to Search
Doctor Screen
Goes to Search
OK
Diagnosis Screen
Press 3 for go to Search
Diagnosis screen
Go to Search
Diagnosis screen
Goes to Search
OK
Payments Screen
Press 0 to exit
Payments screen
Go to Admin Menu
Payments screen
Goes to Admin
OK
Wrong selection
screen
Show error message
Menu screen
Shows error
OK
message
Table 10 Search Details Menu Screen
This prompt will allow users to search an assignment detail of a patient to a doctor by using
patient id.
Test Case
Expected Result
Actual Result
Status
OK
Screen
results
Should redirect by
results
Redirects by two
sub menu
two clicks
clicks
OK
Test Case
Expected Result
Actual Result
Status
OK
Screen
results
Should redirect by
results
Redirects by two
sub menu
two clicks
clicks
OK
This prompt will allow the user to search diagnosis details of a patient by using the patient id.
Test Case
Expected Result
Actual Result
Status
OK
Screen
results
Should redirect by
results
Redirects by two
sub menu
two clicks
clicks
OK
This prompt will allow the user to search payment details of a patient by using the patient id.
Test Case
Expected Result
Actual Result
Status
OK
Screen
results
Should redirect by
results
Redirects by two
sub menu
two clicks
clicks
OK
This prompt will allow the user to search patient details by using the patient id.
Test Case
Expected Result
Actual Result
Status
OK
Screen
results
Should redirect by
results
Redirects by two
sub menu
two clicks
clicks
OK
Test Case
Expected Result
Actual Result
Status
Should appear
Appears Update
OK
prompt
prompt
user input
Appears Update
prompt
Update Gender
user input
Should appear
Appears Update
prompt
Nationality prompt
Update Nationality
Nationality prompt
user input
Should appear
input
Appears Update
Password prompt
Update Password
Password prompt
user input
Should appear
input
Appears Update
prompt
Update Allergy
OK
OK
OK
OK
OK
user input
Press 8 for Save the Details Should save the
OK
prompt
Press 9 for Show updated
details
Should show updated
Show updated
OK
10
Details prompt
Press 0 to exit
details
Go to appropriate sub
details
Goes to appropriate
OK
Wrong selection
menu screen
Show error message
OK
11
message
Table 16 - Update Patient Details Screen
Users can update selected doctor details by using doctor id in this prompt.
Test Case
Expected Result
Actual Result
Status
Should appear
Appears Update
OK
prompt
Update Specialized
Specialized Area
user input
Appears Update
No prompt
Update Contact No
Contact No prompt
user input
Should appear
input
Appears Update
Password prompt
Update Password
Password prompt
OK
OK
OK
user input
Press 5 for Save the Details Should save the
input
Save the details
OK
prompt
Press 6 for Show updated
details
Should show updated
Show updated
OK
Details prompt
Press 0 to exit
details
Go to appropriate sub
details
Goes to appropriate
OK
Wrong selection
menu screen
Show error message
OK
message
Table 17 - Update Doctor Details Screen
Users can update selected diagnosis details of a patient by using patient id in this prompt.
Test Case
Expected Result
Actual Result
Status
Should appear
Appears Update
OK
prompt
Update Illness
user input
Should appear
Appears Update
Treatment prompt
Update Treatment
Treatment prompt
user input
Should appear
input
Appears Update
prompt
OK
prompt
Press 6 for Show updated
details
Should show updated
Show updated
OK
Details prompt
Press 0 to exit
details
Go to appropriate sub
details
Goes to appropriate
OK
Wrong selection
menu screen
Show error message
OK
message
Table 18 Update Diagnosis Details Screen
OK
OK
Users can update selected payment details of a patient by using patient id in this prompt.
Test Case
Expected Result
Actual Result
Status
Should appear
Appears Update
OK
Name prompt
Patient Name
user input
Should appear
user input
Appears Update
prompt
Update Amount
user input
Should appear
Appears Update
prompt
OK
OK
OK
prompt
Press 6 for Show updated
details
Should show updated
Show updated
OK
Details prompt
Press 0 to exit
details
Go to appropriate sub
details
Goes to appropriate
OK
Wrong selection
menu screen
Show error message
OK
message
Table 19 Update Payments Details Screen
This prompt will allow users to search an assignment detail of a patient to a doctor by using
patient id and allows it to be deleted.
2
3
Test Case
Expected Result
Actual Result
Status
OK
and requests to
OK
record
Should redirect to the
Redirects to the
OK
appropriate sub
menu
This prompt will allow users to search a diagnosis detail of a patient by using patient id and
allows it to be deleted.
Test Case
Expected Result
Actual Result
Status
OK
and requests to
OK
record
Should redirect to the
Redirects to the
OK
appropriate sub
menu
This prompt will allow users to search a patient by using patient id and allows deleting the
record.
Test Case
Expected Result
Actual Result
Status
OK
and requests to
delete the results
Deletes the record
OK
OK
record
Should redirect to the
Redirects to the
appropriate sub
menu
This prompt will allow users to search a payment detail by using patient id and allows
deleting the record.
2
3
Test Case
Expected Result
Actual Result
Status
OK
and requests to
OK
record
Should redirect to the
Redirects to the
OK
appropriate sub
menu
Test Case
Expected Result
Actual Result
Status
OK
and requests to
delete the results
Deletes the record
OK
OK
record
Should redirect to the
Redirects to the
appropriate sub
menu
This prompt will allow users to search a nurse by using nurse id and allows deleting the
record.
2
3
Test Case
Expected Result
Actual Result
Status
OK
and requests to
OK
record
Should redirect to the
Redirects to the
OK
appropriate sub
menu
6.0 Conclusion
6.0 References
Balagurusamy, E.(ed.)(2008). Object oriented programming with C++: 4th Edition. McGrawHill companies: McGraw-Hill.