Answer to Question #266263 in C++ for Wendy

Question #266263

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”


1
Expert's answer
2021-11-15T00:46:07-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS