Emphasis on: loops, file input Now that we can use loops and we know how to read all the grades from a file, let’s go back and revisit program 1. A student’s grade in a course is calculated like this: 45% for the 5 highest quiz grades of 6 quizzes taken

computer science

Description

Emphasis on: loops, file input Now that we can use loops and we know how to read all the grades from a file, let’s go back and revisit program 1. A student’s grade in a course is calculated like this: 45% for the 5 highest quiz grades of 6 quizzes taken 25% for 1-6 projects 30% for exams (midterm and final) Write a C++ program for the instructor to run at the end of a semester to produce a grade summary for multiple students. 



 The file semgrades4.txt contains data for an unknown number of students in this format: Line 1: student name Line 2: ix int quiz grades separated by a blank space Line 3: at least one (but possibly up to six) int project grades, separated by a blank space and terminated by -1 Line 4: two int exam grades Line 5: int number of absences Example of file entries: Michael Palin 70 30 70 80 85 90 100 -1 75 85 4 Eric Idle 75 80 70 75 80 70 70 80 90 100 -1 70 88 0 For each student, you should produce output in the format shown below. Print the student’s name, the input quiz grades shown as a series of sums with the lowest grade subtracted, the input project grades shown as a series of sums, the exams grades shown as a sum. All of these sums are followed by the average in that category. The course average should be shown as the sum of the weighted grades the student earned in each category based on the percentage that it counts toward the course average. 



 For example, In the course average line in the first students’s output, 36.0 is 45% of 80 (quiz avg), 25.0 is 25% of 100 (project avg), and 24.0 is 30% of 80 (exam avg). The course average is then adjusted to award extra credit for class attendance. There are 30 class meetings possible, and the student earns .1% of extra credit for each class attended. Here’s sample output for the sample input data: Grade Summary for Michael Palin Quiz average = 75 + 30 + 70 + 80 + 85 + 90 – 30 = 80.0% Project average = 100 = 100.0% Exam average = 75 + 85 = 80.0% Course average = 36.0 + 25.0 + 24.0 = 85.0% Adjusted course average: 85.0 + 2.6 = 87.6% Grade Summary for Eric Idle Quiz average = 75 + 80 + 70 + 75 + 80 + 70 – 70 = 76.0% Project average = 70 + 80 + 90 + 100 = 85.0% Exam average = 70 + 88 = 79.0% Course average = 34.2 + 21.3 + 23.7 = 79.2% Adjusted course average: 79.2 + 3.0 = 82.2% Requirements: Your output should be in the same general format as my examples. Your output should be nicely spaced and readable so that consecutive values aren’t scrunched together. The averages should be floating-point values printed with one digit to the right of the decimal. Define named constants to represent the weight factors (0.45 or 45, 0.25 or 25, etc.) and the maximum number of class meetings so that they could easily be changed as necessary


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.