Answer to Question #274048 in C++ for Amit

Question #274048

write a program to create a class “A” that stores name and age of a student. Create another class “B” that stores two subject marks. Derive another class “C” from “A” and “B” that stores the grade by calculating the following conditions. if average mark >= 90 then grade = ‘O’ else grade is ‘P’. Display all the details of student through the object of class ‘C’


1
Expert's answer
2021-12-08T16:30:33-0500
class A
{
private:
    string name;


public:
    int age;
    A(string, int)
    {
        this->age = age;
        this->name = name;
    }
};
class B
{
private:
    char marks_a, mark_b;


public:
    B(char, char)
    {
        this->mark_b = mark_b;
        this->marks_a = marks_a;
    }
};

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