Q:

C++ program to find the eligibility for an engineering course based on the criteria

0

C++ program to find the eligibility of admission for an engineering course based on the following criteria.

Marks in Maths >=65

Marks in Phy >=55

Marks in Chem>=50

Total in all three subject >=180

or

Total in Math and Subjects >=140

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<iostream>
using namespace std;

int main()
{

    int p, c, m, t, mp;

    cout << "Eligibility Criteria for an engineering:" <<endl;
    cout << "Marks in Mathematics >= 65" <<endl;
    cout << "Marks in Physics >= 55" <<endl;
    cout << "Marks in Chemestry >= 50" <<endl;
    cout << "Total in all three subject >= 180" <<endl;
    cout << "or Total in Maths and Physics >= 140" <<endl;
    cout << "-------------------------------------" <<endl;

    cout << "Input the marks obtained in Physics :" <<endl;
    cin >> p;
    cout << "Input the marks obtained in Chemistry :" <<endl;
    cin >> c;
    cout << "Input the marks obtained in Mathematics :" <<endl;
    cin >> m;
    cout << "Total marks of Mathematics, Physics and Chemistry :" << m + p + c << endl;
    cout << "Total marks of Maths and  Physics :" << m + p;

    if (m>=65)

        if(p>=55)

            if(c>=50)

                if((m + p + c) >= 180 || (m + p) >= 140)
                    cout << "The  candidate is eligible for admission." <<endl;

                else
                    cout << "The candidate is not eligible." <<endl;
            else
                cout << "The candidate is not eligible."<<endl;
        else
            cout << "The candidate is not eligible."<<endl;
    else
        cout << "The candidate is not eligible."<<endl;

}

Result:

Eligibility Criteria for an engineering:

Marks in Mathematics >= 65

Marks in Physics >= 55

Marks in Chemestry >= 50

Total in all three subject >= 180

or Total in Maths and Physics >= 140

-------------------------------------

Input the marks obtained in Physics :

80

Input the marks obtained in Chemistry :

80

Input the marks obtained in Mathematics :

80

Total marks of Mathematics, Physics and Chemistry :240

Total marks of Maths and  Physics :160The  candidate is eligible for admission.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ program to calculate the total marks, percenta... >>
<< C++ program to detrermine a candidate’s age is e...