Create a program that will calculate your grade in Prelim, Midterm, Prefinals, and Finals. After that, determine if you passed or failed in that subject based on your calculated grade.
#include<iostream>
using namespace std;
int main(){
cout<<"Enter the Prelim\n";
double Prelim;
cin>>Prelim;
cout<<"Enter the Midterm\n";
double Midterm;
cin>>Midterm;
cout<<"Enter the Prefinals\n";
double Prefinals;
cin>>Prefinals;
cout<<"Enter the Finals\n";
double Finals;
cin>>Finals;
double total = Prelim + Midterm + Prefinals+ Finals;
cout<<"Total "<<total<<endl;
if(total<50){
cout<<"Failed\n";
}
else{
cout<<"Passed\n";
}
}
Comments
Leave a comment