Write a program that computes your percentage grade for CS135 given the percenta
ID: 639961 • Letter: W
Question
Write a program that computes your percentage grade for CS135 given the percentage weight for each portion of this CS135 class in the class syllabus.
You may assume:
? six (6) projects plus a final project
? five (5) quizzes
So your program should read the grade (a number between 0.00 and 100.00) for each portion
of the class from the terminal in the following order
1. Projects (all six)
2. Midterms (two)
3. Quizzes (all fve)
4. Final Project
5. Final Exam
After reading these fifteen values from the terminal, your program should then compute and
print the following:
1. The average Projects grade (not including the final project)
2. The average Quizzes grade (average of quizzes only)
3. The final percentage grade
on the terminal. Here is sample output:
Average projects grade: 87.50
Average quizzes grade: 97.20
Final grade: 92.45
Programming assignments 40% Final Project 10% Midterm exams 20% (10% each) Exercises and Quizzes 10% Final Exam 20%Explanation / Answer
#include <stdio.h>
int main ()
{
float PA, FP, MT, QZ, FE, Grade;
float temp;
int i = 0;
PA = 0;
for(i = 0; i < 6; ++i){
scanf("%f", &temp);
PA += temp;
}
PA /= 6;
MT = 0;
for(i = 0; i < 2; ++i){
scanf("%f", &temp);
MT += temp;
}
MT /= 2;
QZ = 0;
for(i = 0; i < 5; ++i){
scanf("%f", &temp);
QZ += temp;
}
QZ /= 5;
scanf("%f", &FP);
scanf("%f", &FE);
Grade = ((PA * 0.4) + (FP * 0.1) + (MT * 0.2) + (QZ * 0.1) + (FE * 0.2));
printf("Average projects grade: %.2f ", PA);
printf("Average quizzes grade: %.2f ", QZ);
printf("Final grade: %.2f ", Grade);
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.