Input course code or Enter to quit Grade in COP1000 is 92% Grade in MAT1000 is 80% Grade in PHY1000 is 64% Grade in ETH1000 is 85% Grade in COM1000 is 78% Current term average is 79.8% Worst course is PHY1000 : 64% Dropped PHY1000


C++ code for the given output
#include <iostream>
using namespace std;
int main() {
int x,y,z,a,b;
double average,final_average;
cin>>x>>y>>z>>a>>b;
cout<<"Grade in COP1000 is "<<x<<"%"<<endl;
cout<<"Grade in MAT1000 is "<<y<<"%"<<endl;
cout<<"Grade in PHY1000 is "<<z<<"%"<<endl;
cout<<"Grade in ETH1000 is "<<a<<"%"<<endl;
cout<<"Grade in COM1000 is "<<b<<"%"<<endl;
average=((x+y+z+a+b)/5);
cout<<"Current term average is "<<average<<"%"<<endl;
cout<<"Worst course is PHY1000 "<<z<<"%"<<endl;
cout <<"Dropped PHY1000"<<endl;
cout<<"Here is my revised grades "<<endl;
cout<<"Grade in COP1000 is "<<x<<"%"<<endl;
cout<<"Grade in MAT1000 is "<<y<<"%"<<endl;
cout<<"Grade in ETH1000 is "<<a<<"%"<<endl;
cout<<"Grade in COM1000 is "<<b<<"%"<<endl;
final_average= ((x+y+a+b)/4);
cout<<"Revised term average "<<final_average<<"%"<<endl;
}
Step by step
Solved in 2 steps with 1 images









