Question: Can Someone Please Help me write this code in C++? You are to write a small grading program for an instructor, used to enter quiz
Can Someone Please Help me write this code in C++?
You are to write a small grading program for an instructor, used to enter quiz scores and calculate average scores for a group of students. First, ask the user to enter the number of students. You may assume the user enters a number between 1 and 20. Next, ask the user to enter the number of quizzes. You may assume the user enters a number between 1 and 10. For each student: - Ask the user to enter the students name. Since the name may have spaces, use getline() instead of cin >> to ask for the name. You will probably have to use cin.ignore() to get this to work correctly.
Hint: string aStringWithSpaces; cout > numericVariable; getline(cin, aStringWithSpaces);
- Store the entered name in an array of student names.
- Ask the user to enter the quiz scores for this student. Print the quiz number in the prompt (hint: cout
- Calculate the average for this student (sum / number of scores).
- Store the students average in an array of averages. o Note that the average[0] belongs to name[0], average[1] to name[1], etc. After data for all students is entered, find the highest and lowest averages among all students.
Finally, print a report: on each line:
- print the students name in a field width of 15, left justified
- print the students average, right justified, with one digit past the decimal point. The last two lines of the report should report the highest and lowest averages in the group of students.
End the program with the normal system pause.
Line up user inputs as shown on the example.
See the sample execution on the next page.
Line up user inputs as shown on the example.
Enter number of students 1-20 3 Enter number of quizzes (1-10 2 Enter student name Rick Flair Enter score 1: Enter score 2: Enter student nameArn Anderson Enterscore 1: Enter score 2 Enter student name Steve Austin Enter score 1: Enter score 2: Rick Flair Arn Anderson Steve Austin Highest Average: Loest Average: Press any key to continue.. 89 93 81 86 71.5 91.0 83.5 91.0 71.5 Rubrics: Style Stardad corrrient box al the lo Good use of variable names iood indentation, spacing, and co Coding Standards: No "naked literals. Use constants it needed Solution Codi Asks for all values as specified Allows spaces in names entered Asks for the correct number of scores for each student Includes the quiz number in the pro Calculates the correct averaze oach studen Finds the correct highest and lowest averages from all student Uses a separate loop or loops to find the highest and lowest (not in same loop as input). Presentation: Prints the User Inputs and results are in the format shown above System Pause at the end mmenting starting with 1, for each quiz score t as instructed and in the format shown above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
