PF Project 1
PF Project 1
Submitted by:
Wardah Khan – L1S24BSCS0173
Abdul Hadi Raza - L1S24BSCS0181
1. Workflow Chart:
2. Prototype Design:
1. Menu layout:
Program starts
Menu is displayed
User enters option according to requirement.
Menu:
Enter 1 if you want to admit a patient.
Enter 2 if you want to discharge a patient.
Enter 3 if you want to admit update patient record.
Enter 4 if you want to generate patient summary report.
Enter 5 if you want to schedule an appointment.
Enter 6 to Exit program.
Enter choice:
User will be asked to enter an Integer to start working with the program.
If user enters 1:
Input:
Name: Muhammad Ali
Address: 123 Main Street
Blood Group: O+
Output:
“Patient admitted successfully”
If user enters 2:
Input:
Name: Subhan Ahmed
Output:
If the patient is found: “Patient discharged!”
If the patient is not found: “Patient not found!”
If user enters 3:
Input:
New Address: 123 Lahore Road
New Blood Group: A+
Output:
If updated: "Patient record updated!"
If not found: "Patient not found!"
If user enters 4:
Input:
No input required.
Output:
Total Patients: 10
Blood Group Distribution:
A+: 4
B+: 2
AB+: 1
O+:3
If user enters 5:
Input:
Patient Name: Subhan Ahmed
Doctor Name: Usman Waleed
Appointment Time: 10:00 am
Output:
If successful: "Appointment scheduled!"
If the time slot is taken: "Time slot unavailable!"
If user enters 6:
Input:
User selects the 6 option from the menu.
Output:
"Exiting the program."
3. Functional Modules:
File Handling:
void discharge_patient();
Description:
This function searches for a patient by name and removes their record from the file.
void update_patient_record();
Description:
This function modifies patient details such as address or blood group in the file.
void schedule_appointment();
Description:
This function adds an appointment to a file for a specific patient and doctor with a
selected time slot.
void exit_program();
Description:
This function allows the user to exit the program safely after saving any changes made to
the files.
3. Testing Plan:
Case 1:
Enter 1 if you want to admit a patient.
Enter 2 if you want to discharge a patient.
Enter 3 if you want to admit update patient record.
Enter 4 if you want to generate patient summary report.
Enter 5 if you want to schedule an appointment.
Enter 6 to Exit program.
Enter choice: 7
Please enter a valid number!
Enter 1 if you want to admit a patient.
Enter 2 if you want to discharge a patient.
Enter 3 if you want to admit update patient record.
Enter 4 if you want to generate patient summary report.
Enter 5 if you want to schedule an appointment.
Enter 6 to Exit program.
Enter choice:
Case 2:
Enter 1 if you want to admit a patient.
Enter 2 if you want to discharge a patient.
Enter 3 if you want to admit update patient record.
Enter 4 if you want to generate patient summary report.
Enter 5 if you want to schedule an appointment.
Enter 6 to Exit program.
Enter choice: A
Please enter a valid number!
Enter 1 if you want to admit a patient.
Enter 2 if you want to discharge a patient.
Enter 3 if you want to admit update patient record.
Enter 4 if you want to generate patient summary report.
Enter 5 if you want to schedule an appointment.
Enter 6 to Exit program.
Enter choice:
Case 3:
Enter 1 if you want to admit a patient.
Enter 2 if you want to discharge a patient.
Enter 3 if you want to admit update patient record.
Enter 4 if you want to generate patient summary report.
Enter 5 if you want to schedule an appointment.
Enter 6 to Exit program.
Enter choice: 1
Enter Patient Name: 12345
Please enter a valid name!