Take student name Take his homework 1 homework2 homework 3 a

Take student name Take his homework 1, homework2, homework 3, and homework 4 grades. Take his quiz 1. quiz2. quiz 3, and quiz 4 grades Take his Midterm 1, and Midterm2 grades Take his final exam grade Calculate the average of homework. Calculate the average of quiz. Calculate the final exam grade: Output the final grade Output word \"Press \"if the grade equal and more the 60., and output word \"failed\" if the grade equal less than 60.

Solution

Here is the code for you:

#include <iostream>
using namespace std;
int main()
{
//Take student name.
string name;
cout<<\"Enter the student name: \";
cin>>name;
//Take his 4 homework grades.
int hw1, hw2, hw3, hw4, qz1, qz2, qz3, qz4, midterm1, midterm2, finalexamGrade;
cout<<\"Enter the 4 homework grades: \";
cin>>hw1>>hw2>>hw3>>hw4;
//Take his 4 quiz grades.
cout<<\"Enter the 4 quiz grades: \";
cin>>qz1>>qz2>>qz3>>qz4;
//Take his 2 midterm grades.
cout<<\"Enter the 2 midterm grades: \";
cin>>midterm1>>midterm2;
//Take his final exam grade.
cout<<\"Enter the final exam grade: \";
cin>>finalexamGrade;
//Calculate the average of homework.
double homeworkAvg = (hw1 + hw2 + hw3 + hw4) / 4.0;
//Calculate the average of quiz.
double quizAvg = (qz1 + qz2 + qz3 + qz4) / 4.0;
//Calculate the final exam grade.
double finalGrade = homeworkAvg * 0.10 + quizAvg * 0.10 + midterm1 * 0.20 + midterm2 * 0.20 + finalexamGrade * 0.40;
//Output the student name.
cout<<\"Student name: \"<<name<<endl;
//Output the final grade.
cout<<\"Final grade: \"<<finalGrade<<endl;
//Output word Pass if the grade equal and more than 60, and output word failed if the grade less than 60.
if(finalGrade >= 60)
cout<<\"Pass\"<<endl;
else
cout<<\"Failed\"<<endl;
}

 Take student name Take his homework 1, homework2, homework 3, and homework 4 grades. Take his quiz 1. quiz2. quiz 3, and quiz 4 grades Take his Midterm 1, and

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site