Use C++ language to develop an original implementation of a menu-driven program performing a number of tasks
Question:
Use C++ language to develop an original implementation of a menu-driven program performing a number of tasks relating to students? details: displaying all students? details, adding new student to the record, displaying the average mark of all students, finding the maximum marks etc.
Use the following structure for this task.
struct student
{ string name;
int id;
float mark; };
Declare an array named studentArray of the structure type shown above, the size of the array is limited to maximum 100. The main() function handles all interactions with the user and other functions:
? It displays an appropriate welcoming message introducing the program.
? Calls a function named readFile() which opens the text file grades.txt for reading and stores all of the students details from the file to an array named studentArray . The grades.txt has three columns, first column contains name, second column contains id and third column contains mark. The readFile() function has two parameters: one for receiving the file variable and one for the array, both receiving arguments passed by reference.
? It then repeatedly calls the menu() function to display user options, get the user selection returned by the menu() function, use a switch statement to process user request by calling appropriate function(s)
? It displays the result with an appropriate message after processing user request.
? It displays a goodbye message when the user selects thet Quit option from the menu and terminates the program.
The menu() function has no parameters. When called, it displays a menu of 8 options allowing the user to select one and returns this option to the calling main() function. The options displayed should be:
(1) Display students? details
(2) Calculate average of all students? marks
(3) Sort the students? details
(4) Search for a particular student?s mark
(5) Find maximum
(6) Add new student to the record
(7) Quit program
Numerical Methods for Engineers
ISBN: 9780071244299
5th Edition
Authors: Steven C. Chapra, Raymond P. Canale