Create C++ full program that allows Exams Officer to add a Semester Mark and
Examination Mark, and Give Final Mark as Average of the two. The program must then
do the following:
✓ Display Semester mark, Examination mark, and Final mark
✓ If final mark less than 40 results =”FAIL SUBMINIMUM”
✓ If final mark greater than or equal to 40 and less than 50 results=”FAIL
SUPPLEMETARY”
✓ If final mark greater than or equal to 50 and less than 75 results=”PASS”
✓ If final mark greater than 75 and less than 100 results=”PASS DISTINCTION”
✓ Otherwise results= “Invalid Input”
#include <iostream>
#include <string>
using namespace std;
int main(){
float semester_mark, examination_mark, final_mark;
cout<<"Enter semester mark: ";
cin>>semester_mark;
cout<<"Enter examination mark: ";
cin>>examination_mark;
final_mark = (semester_mark + examination_mark) / 2;
string result = "";
if(final_mark < 40 && final_mark >= 0) result = "FAIL SUBMINIMUM";
else if(final_mark >= 40 && final_mark < 50) result = "FAIL SUPPLEMENTARY";
else if(final_mark >= 50 && final_mark < 75) result = "PASS";
else if (final_mark >= 75 && final_mark <= 100) result = "PASS DISTINCTION";
else result = "Invalid Input";
cout<<"Final Mark: "<<final_mark<<endl<<"Results = "<<result<<endl;
return 0;
}
Comments
Leave a comment