The Admission to a professional course is done using the following conditions.
a) Marks in Maths> =60
b) Marks in Physics >=50
c) Marks in chemistry >=40
d) Total in all the three subjects >=200 (or) Total in Maths and Physics >=150
Given the marks of three subjects, write a C++ program to process the applications to list the eligible candidates.
//C++ program to determine if student is eligible for admission for a professional course given marks of 3 subjects
#include <iostream>
using namespace std;
int main()
{
//Marks variables
double maths, physics, chemistry;
//Prompt user for input of the marks
cout<<"Enter Mathematics score: ";
cin>>maths;
cout<<endl;
cout<<"Enter Chemistry score: ";
cin>>chemistry;
cout<<endl;
cout<<"Enter Physicss score: ";
cin>>physics;
cout<<endl;
if((maths + chemistry + physics) >= 200 | (maths + physics) >= 150)
{
cout<<"The student is eligible for admission"<<endl;
}
else
{
cout<<"The student is NOT eligible for admission"<<endl;
}
return 0;
}
Comments
Leave a comment