Answer to Question #188642 in C++ for RAHUL SINGH

Question #188642

Create a class named as Recruitment which is derived from two base classes named as 

Basic qualification and interview. Basic qualification contains the Name, marks in last 

qualification, Interview class contains the marks obtained in interview. Recruitment class 

will display the message as recruited or not recruited. Criteria for recruitment is if the 

marks in last qualification is more than 80 and interview marks are greater than equal to 6 

out of 10 for interview marks. Make sure that negative marks are not allowed.


1
Expert's answer
2021-05-03T15:58:06-0400
#include <iostream>


using namespace std;


//define class BasicQualification


class BasicQualification{
protected:
        string name;
        int qual_marks;
};


//define class interview


class Interview{
    protected:
        int inter_marks;
};


//define class recruitment


class Recruitment: public BasicQualification, public Interview{
    public:
        void Display()
        {
            //get input from the user
            cout<<"Enter name:";
            cin>>name;
            cout<<"Enter the basic qualification marks: ";
            cin>>qual_marks;
            cout<<"Enter interview marks: ";
            cin>>inter_marks;


            //check if the marks entered are negative
            if (qual_marks<0 || inter_marks<0){
                cout<<"Invalid marks";
            }
            else if (qual_marks>80 && inter_marks>=6){
                cout<<name<<" is Recruited"<<endl;
            }
            else{
                cout<<name<<" is not recruited"<<endl;
            }


        }


};


int main(){
    Recruitment r;
    r.Display();

    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