Question: Exercise 1 (to be solved during the lab session): Write a menu-driven C++ program that offers the following menu: 1. Read a list of students

Exercise 1 (to be solved during the lab session): Write a menu-driven C++ program that offers the following menu: 1. Read a list of students 2. Display the list of students 3. Find a student 4. Sort the list of students by id 5. Exit The menu options are described as follows: 1. Read list of students: Read from an input file students.txt a list of student ids and names, and stores them in two parallel arrays. The input file contains an unknown number of input lines (maximum 50 lines). Each line contains a student id and a student name (first name and last name separated by a space). The student ids must be stored in an array called IDS. The student names must be stored in an array called NAMES. The following is an example of what the input file may contain: 67890/13 Faisal Al-Hinai 12345/12 Laila Al-Zadjali 98765/12 Alia Al-Rahbi 43210/14 Salim Al-Amri 2. Display the list of students: Display the list of student ids and names. 3. Find a student: Search for a given student id (entered by the user) and display the student id and name if found. Otherwise display the message Student id not found. 4. Sort the list of students by id: Sort the arrays IDS and NAMES by increasing student id. Your program must define and use one function for each menu option (other than Exit). You may use additional functions if needed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!