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’
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;
}
};
Comments
Leave a comment