x.Hmte a program that accepts from the user homework 1, hw2, hw3, midterm and fi
ID: 3617823 • Letter: X
Question
x.Hmte a program that accepts from the user homework 1, hw2, hw3,midterm and final exam scores for up to 10 students. Declare 5 arrays,
one for each of hw1, hw2, hw3, midterm and final, to read in the scores
of the students. Use sentinel controlled loop and terminate accepting values
when the user enters -1 or the maximum number of students have been entered.
Display the average, standard deviation, largest, smallest and second
smallest of all five grading components in a tabular format. In another table,
display each student's overall grade and the
corresponding letter grade based on our grading scale from our syllabus.
Make sure you check your output carefully with respect to the
following excepted output:
Expected Output:
C:ihtiyatyuva eaching\CSC175F2007Homeworkshw10>hw10-q3.exe
Homework #1 score for Student #1 (or -1 to exit) : -1
C:ihtiyatyuva eaching\CSC175F2007Homeworkshw10>hw10-q3.exe
Homework #1 score for Student #1 (or -1 to exit) : 1234
Invalid score; must be in [0, 100].
Enter Homework #1 for Student #1 one more time : -1
If you want to exit, enter -1 one more time, or
Enter Homework #1 for Student #1 one more time : -1
C:ihtiyatyuva eaching\CSC175F2007Homeworkshw10>hw10-q3.exe
Homework #1 score for Student #1 (or -1 to exit) : 10
Homework #2 score for Student #1 (or -1 to exit) : 10
Homework #3 score for Student #1 (or -1 to exit) : 10
Midterm score for Student #1 (or -1 to exit) : 10
Final Exam score for Student #1 (or -1 to exit) : 10
Homework #1 score for Student #2 (or -1 to exit) : -1
If you want to exit, enter -1 one more time, or
Enter Homework #2 for Student #2 one more time : -1
************ Accepted Student Count = 1. *************
Homework1 Homework2 Homework3 MidTerm Final
========= ========= ========= ======= =====
Average 10 10 10 10 10
Std.Dev 0 0 0 0 0
Largest 10 10 10 10 10
Largest2 10 10 10 10 10
Smallest 10 10 10 10 10
Smallest2 10 10 10 10 10
========================================================================
Total Grade Letter Grade
=========== ============
Student # 1 10 F
R: eaching\CSC175F2007Homeworkshw10>hw10-q3.exe
Homework #1 score for Student #1 (or -1 to exit) : 1000
Invalid score; must be in [0, 100].
Enter Homework #1 for Student #1 one more time : 100
Homework #2 score for Student #1 (or -1 to exit) : 100
Homework #3 score for Student #1 (or -1 to exit) : 100
Midterm score for Student #1 (or -1 to exit) : 100
Final Exam score for Student #1 (or -1 to exit) : 100
Homework #1 score for Student #2 (or -1 to exit) : 59
Homework #2 score for Student #2 (or -1 to exit) : 59
Homework #3 score for Student #2 (or -1 to exit) : 59
Midterm score for Student #2 (or -1 to exit) : 59
Final Exam score for Student #2 (or -1 to exit) : 59
Homework #1 score for Student #3 (or -1 to exit) : 60
Homework #2 score for Student #3 (or -1 to exit) : 60
Homework #3 score for Student #3 (or -1 to exit) : 60
Midterm score for Student #3 (or -1 to exit) : 60
Final Exam score for Student #3 (or -1 to exit) : 60
Homework #1 score for Student #4 (or -1 to exit) : 81
Homework #2 score for Student #4 (or -1 to exit) : 81
Homework #3 score for Student #4 (or -1 to exit) : 81
Midterm score for Student #4 (or -1 to exit) : 81
Final Exam score for Student #4 (or -1 to exit) : 81
Homework #1 score for Student #5 (or -1 to exit) : 49
Homework #2 score for Student #5 (or -1 to exit) : 49
Homework #3 score for Student #5 (or -1 to exit) : 49
Midterm score for Student #5 (or -1 to exit) : 12
Final Exam score for Student #5 (or -1 to exit) : 100
Homework #1 score for Student #6 (or -1 to exit) : -12
Invalid score; must be in [0, 100].
Enter Homework #1 for Student #6 one more time : 21
Homework #2 score for Student #6 (or -1 to exit) : 23
Homework #3 score for Student #6 (or -1 to exit) : 99
Midterm score for Student #6 (or -1 to exit) : 1
Final Exam score for Student #6 (or -1 to exit) : 89
Homework #1 score for Student #7 (or -1 to exit) : 123
Invalid score; must be in [0, 100].
Enter Homework #1 for Student #7 one more time : 33
Homework #2 score for Student #7 (or -1 to exit) : 33
Homework #3 score for Student #7 (or -1 to exit) : 33
Midterm score for Student #7 (or -1 to exit) : 33
Final Exam score for Student #7 (or -1 to exit) : 99
Homework #1 score for Student #8 (or -1 to exit) : 23
Homework #2 score for Student #8 (or -1 to exit) : 34
Explanation / Answer
x.Xlor="red">please rate - thanks #include #include #include using namespace std; bool getscore(int&,int,int,int,int); void message(int,int,int,int); int goodgrade(int); void printhead(int); void printhead2(); double calcaverage(int[],int); double calcstddev(double,int[],int); void getextremes(int[],int&,int&,int&,int&,int); void printextreme(string,int[]); void printaverage(int,int,int,int,int,int); int main() {cout.flags( ios::fixed ); coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.