Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need in C++. Please no java. As with all homeworks in this course, your programs output will display your name, your EUID, your e-mail address,

Need in C++. Please no java.

As with all homeworks in this course, your programs 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 students grade information: o id (int): student id o first (string): first name o last (string): last name o exm1 (int): exm 1 score o exm2 (int): exm 2 score o exm3 (int): exm 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:

2 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 students 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 students id, update the students 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

3 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 programs 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 users input. Then add code/functions to add student and display all the students information. Next, add code/function to update existing students information. Finally, add code/functions to compute mean, minimum, and maximum of the mean of the exams. Submission: We will be using an electronic homework submission on Canvas to make sure that all students hand their programming tasks on time. You will submit both the program source code file(s) to the Homework 1 dropbox on Canvas by the due date and time. The source program that contains main function should be hwk1.cpp. Program submissions will be checked using a code plagiarism tool against other solutions, including those found on the Internet, so please ensure that all work submitted is your own. Any student determined to have cheated will receive an F in the course and will be

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions