Write a C++ program to calculate the course score of CSC 126. 1. A student can enter scores of 3 quizzes, 2 exams, and a final exam. The professor usually keeps 1 digit after the point in each score but the overall course score has no decimal places. 2. The lowest quiz score will not be calculated in the quiz average. 3. The weight of each score is: quiz 20%, exams 30%, and the final 50%. 4. The program will return the weighted average score and a letter grade to the student. 5. A: 91 - 100, B: 81 - 90, C: 70 - 80, F: < 70.

Respuesta :

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

   double quiz1, quiz2, quiz3, exam1, exam2, finalexam,quiz;

   cout<<"Quiz 1: "; cin>>quiz1;

   cout<<"Quiz 2: "; cin>>quiz2;

   cout<<"Quiz 3: "; cin>>quiz3;

   cout<<"Exam 1: "; cin>>exam1;

   cout<<"Exam 2: "; cin>>exam2;

   cout<<"Final Exam: "; cin>>finalexam;

   if(quiz1<=quiz2 && quiz1 <= quiz3){        quiz=(quiz2+quiz3)/2;    }

   else if(quiz2<=quiz1 && quiz2 <= quiz3){        quiz=(quiz1+quiz3)/2;    }

   else{         quiz=(quiz1+quiz2)/2;     }

   int weight = 0.20 * quiz + 0.30 * ((exam1 + exam2)/2) + 0.50 * finalexam;

   cout<<"Average Weight: "<<weight<<endl;

   if(weight>=91 && weight<=100){        cout<<"Letter Grade: A";    }

   else if(weight>=81 && weight<=90){        cout<<"Letter Grade: B";    }

   else if(weight>=70 && weight<=80){        cout<<"Letter Grade: C";    }

   else{        cout<<"Letter Grade: F";    }

   return 0;

}

Explanation:

See attachment for complete program where comments were used to explain difficult lines

Ver imagen MrRoyal