#include #include #include using namespace std; int main() { int homeworkPoints{0}, totalHomeworkPoints{0}; float homeworkWeight{0}, homeworkAverage{0}; int programPoints{0}, totalProgramPoints{0}; float programWeight{0}, programAverage{0}; float testAverage{0}, testWeight{0}; float finalAverage{0}, finalWeight{0}; float tempTotal{0}; float totalWeight{0}; float finalScore{0}; cout << endl; cout << "Enter the points earned on homework => "; cin >> homeworkPoints; cout << "Enter the total homework points available => "; cin >> totalHomeworkPoints; cout << "Enter the weight of the homework => "; cin >> homeworkWeight; homeworkAverage = static_cast(homeworkPoints) / static_cast (totalHomeworkPoints); tempTotal = homeworkAverage * homeworkWeight; totalWeight = homeworkWeight; cout << endl; cout << "Enter the points earned on program => "; cin >> programPoints; cout << "Enter the total program points available => "; cin >> totalProgramPoints; cout << "Enter the weight of the program => "; cin >> programWeight; programAverage = static_cast(programPoints) / static_cast (totalProgramPoints) ; tempTotal += programAverage * programWeight; totalWeight += programWeight; cout << "Enter the test average => " ; cin >> testAverage; cout << "Enter the test weight => "; cin >> testWeight; tempTotal += testAverage * testWeight; totalWeight += testWeight; cout << "Enter the final exam average => " ; cin >> finalAverage; cout << "Enter the final exam weight => "; cin >> finalWeight; tempTotal += finalAverage * finalWeight; totalWeight += finalWeight; finalScore = tempTotal / totalWeight * 100; cout << endl; cout << "Averages" << endl; cout << "Homework: " << static_cast( homeworkAverage*100+0.5) << "%" << endl; cout << "Program: " << static_cast(programAverage*100+0.5) << "%" << endl; cout << "Test: " << static_cast(testAverage*100+0.5) << "%" << endl; cout << "Final Exam: " << static_cast(finalAverage*100+0.5) << "%" << endl; cout << fixed << setprecision(2); cout << "The class average is " << finalScore << "%" << endl; return 0; }