Answer to Question #174466 in C++ for Keega

Question #174466

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-03-23T03:40:08-0400
#include <iostream>


inline bool Admissible(int math, int physics, int chemistry) {
    return {
        math >= 60
        && physics >= 50
        && chemistry >= 40
        && (
            (math + physics + chemistry) >= 200
            || (math + physics) >= 150
        )
    };
}


int main() {
    int math, physics, chemistry;
    std::cin >> math >> physics >> chemistry;


    if (Admissible(math, physics, chemistry)) {
        std::cout << "Welcome!\n";
    }
    else {
        std::cout << "You shall not pass!\n";
    }
    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