0% found this document useful (0 votes)
39 views1 page

OOP - Practical Paper

The program manages doctor records for Benazir Bhutto Hospital. It allows users to (1) add new doctor records to a file, (2) display all doctor records, (3) search for a record and display it or a not found message, (4) change a doctor's status, and (5) display the top five highest paid doctors sorted by salary. Each record contains a doctor ID, name, status, and salary. The program stores records in the BBH_Doctors.text file and prompts the user to continue adding records or not. Exception handling is added to check if the file fails to open and prompt for a correct name if a search record is not found.

Uploaded by

Atif Saeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views1 page

OOP - Practical Paper

The program manages doctor records for Benazir Bhutto Hospital. It allows users to (1) add new doctor records to a file, (2) display all doctor records, (3) search for a record and display it or a not found message, (4) change a doctor's status, and (5) display the top five highest paid doctors sorted by salary. Each record contains a doctor ID, name, status, and salary. The program stores records in the BBH_Doctors.text file and prompts the user to continue adding records or not. Exception handling is added to check if the file fails to open and prompt for a correct name if a search record is not found.

Uploaded by

Atif Saeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

QUESTION NO.

1 15 POINTS
Government of Punjab has announced e-Government system in all offices. Benazir Bhutto Hospital has
started maintaining its doctor’s record in digital files instead of traditional files.
You are hired to develop a menu driven program for managing on job doctor’s records.
The program should facilitate adding new doctor record in a file (2 POINTS), display all doctors’ record
(2 POINTS), fetching doctor’s record from a file using searching and displaying it on screen (if the record
found your system print the whole information of that employ otherwise give the message “record not
found”) (2 POINTS), changing doctor’s status (on job/ on leave) (2 POINTS), and displaying top five
highly paid doctors in BBH (using sorting) (2 POINTS).
The doctors have following attributes (2 POINTS)
Doctor_ID (an integer)
Doctor_Name (single name and max of 20 characters)
Doctor_status (max of 15 characters)
Doctor_Salary (floating point)
Your program stores all the records in the file BBH_Doctors.text. Assume that user wants to enter several
records and then print or search them (your program ask the user do you want to continue Y/N) (3
POINTS).
QUESTION NO. 2 5 POINTS
In Question No. 1, we are adding the data into a file name BBH_Doctors.text, you have to add the exception
handing to check if the file is not opening, your program will display the file name and a message that the
file is not opening.
Also you have to add the exception handing where the user will search for the record, if record is not found,
your program will show the message, enter the Correct Name of the Doctor to Find.

You might also like