Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

COSC 1436 Programming Assignment 5 Programming Assignment 5 In this assignment, you will refactor the program that you wrote for Assignment 3. The output of

COSC 1436 Programming Assignment 5 Programming Assignment 5 In this assignment, you will refactor the program that you wrote for Assignment 3. The output of this program should be exactly the same as Assignment 3 except that the data will be sorted. The program should present a menu to the user asking if they would like display the average grade, maximum grade, or minimum grade. The program should then display the information in a table. The table should include the student name along with the chosen data (average, minimum, or maximum). In addition, the information should be sorted from high to low by the data selected. Instead of using parallel arrays, you will need one vector of a struct of students. You can use the following struct: struct Student { string name; double average; int max; int min; }; The program should do the following: Load the names of students into a vector of Student struct. For each student calculate the average, maximum, and minimum grade and store that in the struct as well. The file used will be called NamesGrades.txt. Continuously present a menu to the user given him/her the options of average, maximum, minimum, or quit. If the user chooses to quit, the program should end otherwise the presentation of the menu should continue. Display a table of appropriate grades based on the users selection sorted by the appropriate grades. Make sure you use good programming style. This includes commenting ALL your variables and commenting throughout your code. Comments should explain why you are doing something. Use good indentation (see my examples and the books examples for demonstration of good indentation). Make sure variable names are self-documenting. Make good use of white space. Group logical sections together with one blank line between logical sections. Your output should be neat and pleasant to read. COSC 1436 Programming Assignment 5 Make sure you follow the specifications. If you must, you can add to the program, but do not change the specifications in doing so. You need to submit a file by the name of the file to PA5_lastName_firstName.cpp, replacing lastName with your actual last name and firstName with your actual first name. Failure to properly name your file results in loss of points. COSC 1436 Programming Assignment 5 Below is possible output for a sample run for this programming assignment: Grade Report Program 1. Display Average Grade 2. Display Maximum Grade 3. Display Minimum Grade 4. Quit Program Enter your choice (1-4): 1 Grade Averages Name Average Grade Zack Nutt 87.2 B Haily Wright 84.2 B Victoria Taylor 83.0 B Edward Maun 82.6 B Rebecca Brown 81.6 B Sidra Amartey 78.4 C Diana Patel 77.0 C Dawn Hopkins 76.2 C Hannah Shrestha 76.2 C Ashley Guillen 75.8 C Kyle Jiwani 75.0 C Abigail Peterson 75.0 C Leslie Carter 74.8 C Angelo Morrison 74.6 C Jennifer Putnam 73.0 C Ryan Hilliard 72.4 C Michael Nguyen 70.6 C Melvin Johnson 68.4 D Linda Stoll 64.2 D Kimberly Sanjel 63.2 D Marisa Santos 61.0 D Patrick Perez 56.0 F Press any key to continue . . . COSC 1436 Programming Assignment 5 Grade Report Program 1. Display Average Grade 2. Display Maximum Grade 3. Display Minimum Grade 4. Quit Program Enter your choice (1-4): 2 Max Grades Name Max Grade Ryan Hilliard 100 A Kyle Jiwani 99 A Edward Maun 99 A Hannah Shrestha 99 A Haily Wright 99 A Rebecca Brown 98 A Zack Nutt 98 A Angelo Morrison 97 A Kimberly Sanjel 97 A Ashley Guillen 95 A Victoria Taylor 95 A Michael Nguyen 93 A Leslie Carter 92 A Jennifer Putnam 91 A Linda Stoll 91 A Sidra Amartey 90 A Marisa Santos 90 A Dawn Hopkins 88 B Melvin Johnson 88 B Diana Patel 88 B Patrick Perez 88 B Abigail Peterson 85 B Press any key to continue . . . COSC 1436 Programming Assignment 5 Grade Report Program 1. Display Average Grade 2. Display Maximum Grade 3. Display Minimum Grade 4. Quit Program Enter your choice (1-4): 3 Min Grades Name Min Grade Zack Nutt 74 C Rebecca Brown 73 C Edward Maun 72 C Sidra Amartey 70 C Diana Patel 68 D Haily Wright 68 D Dawn Hopkins 66 D Abigail Peterson 64 D Victoria Taylor 63 D Ryan Hilliard 52 F Jennifer Putnam 39 F Melvin Johnson 38 F Leslie Carter 36 F Angelo Morrison 31 F Michael Nguyen 28 F Ashley Guillen 26 F Linda Stoll 23 F Marisa Santos 15 F Hannah Shrestha 13 F Kimberly Sanjel 12 F Kyle Jiwani 7 F Patrick Perez 7 F Press any key to continue . . . COSC 1436 Programming Assignment 5 Grade Report Program 1. Display Average Grade 2. Display Maximum Grade 3. Display Minimum Grade 4. Quit Program Enter your choice (1-4): 4 -------------------------------- Process exited with return value 0 Press any key to continue . . .

txt.file=

Sidra Amartey 90 88 70 74 70 Rebecca Brown 85 98 73 78 74 Leslie Carter 92 73 86 36 87 Ashley Guillen 95 26 90 83 85 Ryan Hilliard 75 66 69 100 52 Dawn Hopkins 84 69 66 88 74 Kyle Jiwani 7 99 96 84 89 Melvin Johnson 73 80 63 38 88 Edward Maun 82 85 72 75 99 Angelo Morrison 95 97 80 31 70 Michael Nguyen 71 70 91 93 28 Zack Nutt 82 85 97 74 98 Diana Patel 77 70 88 68 82 Patrick Perez 87 77 21 88 7 Abigail Peterson 64 81 75 85 70 Jennifer Putnam 39 91 85 80 70 Kimberly Sanjel 64 69 74 97 12 Marisa Santos 63 77 90 15 60 Hannah Shrestha 13 77 95 97 99 Linda Stoll 50 85 72 91 23 Victoria Taylor 95 93 74 63 90 Haily Wright 80 90 99 68 84

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students explore these related Databases questions