Answer to Question #184596 in C++ for Ajith

Question #184596

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. [Note: Use call by value]


1
Expert's answer
2021-04-23T07:45:03-0400
#include<bits/stdc++.h>
using namespace std;
int IsApplicable(float Maths,float Physics,float chemistry)
{
    float total,t_phy_math;
    total=Maths+Physics+chemistry;
    t_phy_math=Maths+Physics;
    if(Maths>=60 && Physics >=50 && chemistry >=40)
    {
        if(total>=200 || t_phy_math>=150)
        {
            return 1;
        }
        else
        {
            return 0;
        }
    }
    else
    {
        return 0;
    }
}
int main()
{
    float Maths,Physics,chemistry;
    cout<<"Enter marks in Maths ";
    cin>>Maths;
    cout<<"\nEnter marks in Physics ";
    cin>>Physics;
    cout<<"\nEnter marks in Chemistry ";
    cin>>chemistry;
    if(IsApplicable(Maths,Physics,chemistry))
    {
        cout<<"\nThe applicant is eligible for admission";
    }
    else
    {
        cout<<"\nThe applicant is not eligible for admission";
    }
}

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