Answered step by step
Verified Expert Solution
Question
1 Approved Answer
you will write a complete C++ program that will display a menu and based on user input, perform a variety of operations to process
you will write a complete C++ program that will display a menu and based on user input, perform a variety of operations to process the grades using structures. This is an individual work. Program Requirements: As with all homeworks in this course, your program's output will display your name, your EUID, your e-mail address, the department name, and course number. This means that your program will print this information to the terminal (see Sample Output). Your program is to use a data structure (called Student) to read and store student's grade information: oid (int): student id first (string): first name last (string): last name exam1 (int): exam 1 score exam2 (int): exam 2 score o o exam3 (int): exam 3 score o mean (float): mean/average of the three exams You will need to create an array of students of 20 students. You will also need an index counter variable to count the number of students added in the array. In a loop of your choice, you repeatedly display a menu of options until the user enters the selection to terminate the program as follows: 1. Display list of students' information 2. Add new student 3. Update existing student 4. Compute mean of the exams 5. Compute minimum of the mean of the exams 6. Compute maximum of the mean of the exams 7. Exit program. Although you may assume that the user enters an integer in response to this menu, the integer may be out of range. If the user enters an invalid menu option (i.e., not an integer between 1 and 7, inclusively), your program will display an error message and re-display the menu. If the user enters an integer between 1 and 7, inclusively, then your program will perform the requested operation as follows: 1. Display list of students' information You will display all the attributes (data member values) of the students. 2. Add new student You will prompt for and read in all the data member values of the student, append the student information in the array, increase the student index counter, and then display a status message indicating that the student was just added to the array. 3. Update existing student You will prompt for and read in the student id to update the student's information, perform a sequential search in the array to find the student by its id: If the student id is found in the array, then you will prompt for all the data member values except the student's id, update the student's information in the array, and display a status message indicating student's information was updated. If the student id is not found, then display a status message indicating that the student was not found. . 4. Compute mean of the exams You will compute the accurate mean/average of the mean of the exams of all the students in the array and display the result. 5. Compute minimum of the mean of the exams You will find the minimum value of the mean of the exams of all the students in the array and display the result. 6. Compute maximum of the mean of the exams You will find the maximum value of the mean of the exams of all the students in the array and display the result. 7. Exit program You will display a meaningful message that the program is terminating and exit the program. After performing the above operations and printing the results, you will re-display the menu and accept new user input, thus repeating the process (except in the case of option 7 where the user wants to terminate the program). You will perform needed error handling, such as attempting to perform an operation on an empty list by displaying an error message instead of actually performing the operation (see Sample Output). Your program will also be graded based upon your program style. This means that you should use comments (as directed), meaningful variable names, and a consistent indentation style. Your code should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date, and brief description), comments for each variable, and commented blocks of code. Your program will be graded based largely on whether it works correctly on the CSE machines (e.g., cell01, cell02,..., cell06), so you should make sure that your program compiles and runs on a CSE machine. No regular or late credit will be given for any program that does not compile and run on the CSE Linux servers. See the Sample Output for questions on the program's expected behavior. You should contact your instructor if there is any question about what is being asked for in this programming assignment. Hint: Break the programming into smaller phases/functions. First, write code to show menu and implement loop to read user's input. Then add code/functions to add student and display all the students' information. Next, add code/function to update existing student's information. Finally, add code/functions to compute mean, minimum, and maximum of the mean of the exams.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
C include include using namespace std Define the Student structure struct Student int id string firs...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started