Question: C+ Write a menu driven program to define an array of structures to store the details of 40 staff in a company. The details include
Write a menu driven program to define an array of structures to store the details of 40 staff in a company. The details include Employee name (string). Employee ID (integer), Designation (string). The program should show a menu by calling the function Menu and prompt the user to enter his choice. Program should call the below functions according to the user's choice. If the user selects the exit option, the program should exit. (30 marks) Program should create three user defined functions such as: a) void Menu (void) - This function will display the following menu. (10 marks) 1. Add new Employee 2. Search the details of an employee 3. Exit b) void AddEmployee (void) - This function is called when the user select option 1. The function is used to add a new employee into the structure. The function should prompt the user to enter the new employee details such as name, ID and designation and store it into the structure. If the user wants to add more than 40 employees, then the following message should be printed on the screen. "Reached the limit! Cannot add more employees - (25 marks) c) void SearchEmployee(void) - This function is called when the user selects option 2. This function should prompt the user to enter the name of the employee to be searched in the structure. If the name is found in the structure, then the function should print it along with all the details of that employee; otherwise print "The name is not found! (25 marks) Add your name and ID as comment at the beginning of the code. (5 marks) Output Format
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
