[Solved]Design Implement Menu Based Hospital Simulation Program Using C Programming Language Progr Q37220900
You will design and implement a menu-based hospitalsimulation program using C++ programming language. Your programwill keep track of of three entities (lists) Departments, Staff,and Patients in the hospital. The user will be able to manipulatethe elements of the lists using menu options.
Main menu will have three sub menus and an option toexit the program.
1. Department menu
2. Staff menu
3. Patient menu
4. Exit
Your program will ask the user what is the choice andaccordingly show the corresponding sub menu or exit theprogram.
Your program will terminate only if the user chooses the’Exit’ option in the main menu.
Each sub menu will have options to
1. List all
2. Add one
3. Search one
4. Edit one (Extra Credit)
5. Delete one (Extra Credit)
6. Return to main menu
1. List all: All the information about all the membersof the corresponding list (Department, Staff, or Patient) will belisted on the screen in a nicely formatted way.
2. Add one: User needs to add new member (a new patient,department, or staff) to the corresponding list.
3. Search one: User wants to search for a specificmember (a patient, department, or staff) of a list using the ID ofthe member. If found, the program will list all the informationabout the searched member on the screen in a nicely formatted way.If not found, the program will print a “Not found” message to theuser on the screen.
Must use input and output files
#include “pch.h”
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
void mainMenu();
void departmentMenu();
void staffMenu();
void patientMenu();
int main();
int main()
{
char choice = ‘0’;
do
{
mainMenu();
cin >> choice;
switch (choice)
{
case ‘1’:
system(“CLS”);
departmentMenu();
case ‘2’:
system(“CLS”);
staffMenu();
case ‘3’:
system(“CLS”);
patientMenu();
case ‘4’:
cout <<“Thank you for using my program” << endl;
system(“pause”);
exit(0);
default:
cout <<“Invalid option” << endl;
}
} while (choice != ‘4’);
}
void mainMenu()
{
cout << “Main Menu:” << endl
<< “1. Department Menu”<< endl
<< “2. Staff Menu” <<endl
<< “3. Patient Menu” <<endl
<< “4. Exit the program”<< endl
<< “Enter a choice (1-4):”;
}
void departmentMenu()
{
char choice = ‘0’;
do
{
cout << “Department Menu:”<< endl
<< “1.List all Departments” << endl
<< “2. Addone Department” << endl
<< “3.Search one Department” << endl
<< “4.Edit one Department” << endl
<< “5.Delete one Department” << endl
<< “6.Return to main menu” << endl
<< “Entera choice (1-6): “;
cin >> choice;
switch (choice)
{
case ‘1’:
system(“CLS”);
case ‘2’:
system(“CLS”);
cout <<“This option hasnt been implemented yet.” << endl;
case ‘3’:
system(“CLS”);
cout <<“This option hasnt been implemented yet.” << endl;
case ‘4’:
system(“CLS”);
cout <<“This option hasnt been implemented yet.” << endl;
case ‘5’:
system(“CLS”);
cout <<“This option hasnt been implemented yet.” << endl;
case ‘6’:
system(“CLS”);
main();
default:
cout <<“Invalid option” << endl;
}
} while (choice != ‘6’);
}
void staffMenu()
{
int choice = 0;
do
{
cout << “Staff Menu:”<< endl
<< “1.List all Staffs” << endl
<< “2. Addone Staff” << endl
<< “3.Search one Staff” << endl
<< “4.Edit one Staff” << endl
<< “5.Delete one Staff” << endl
<< “6.Return to main menu” << endl
<< “Entera choice (1-6): “;
cin >> choice;
switch (choice)
{
case ‘1’:
cout <<“This option hasnt been implemented yet.” << endl;
case ‘2’:
cout <<“This option hasnt been implemented yet.” << endl;
case ‘3’:
cout <<“This option hasnt been implemented yet.” << endl;
case ‘4’:
cout <<“This option hasnt been implemented yet.” << endl;
case ‘5’:
cout <<“This option hasnt been implemented yet.” << endl;
case ‘6’:
system(“CLS”);
main();
default:
cout <<“Invalid option” << endl;
cin >>choice;
}
} while (choice != 6);
}
void patientMenu()
{
int choice = 0;
do
{
cout << “Patient Menu:”<< endl
<< “1.List all Patients” << endl
<< “2. Addone Patients” << endl
<< “3.Search one Patient” << endl
<< “4.Edit one Patient” << endl
<< “5.Delete one Patient” << endl
<< “6.Return to main menu” << endl
<< “Entera choice (1-6): “;
cin >> choice;
switch (choice)
{
case 1:
cout <<“This option hasnt been implemented yet.” << endl;
case 2:
cout <<“This option hasnt been implemented yet.” << endl;
case 3:
cout <<“This option hasnt been implemented yet.” << endl;
case 4:
cout <<“This option hasnt been implemented yet.” << endl;
case 5:
cout <<“This option hasnt been implemented yet.” << endl;
case 6:
system(“CLS”);
mainMenu();
default:
cout <<“Invalid option” << endl;
cin >>choice;
}
} while (choice != 6);
I’m having some issues figuring out how to complete the 3required options. I have created a department class in a .h filebut I’m confused on where to go from there.
Expert Answer
Answer to You will design and implement a menu-based hospital simulation program using C++ programming language. Your program will… . . .
OR

