Answer to Question #272204 in C++ for matetemaake

Question #272204

Create a class called Student; this class is inherited from the Subject class.


This class must have the following data members:


A student number, for example “200605544”.A character member for storing a student gender, for example ‘M’ for male and ‘F’ for female


This class must have the following methods:


A public default constructor that sets data members to appropriate default values.A setStudent method that provides the relevant data members with valid


supplied values. Ensure that a student number is not an empty string and that


only M/mF/f are supplied for gender.A method called getStudNum that returns a student number.A method called getGender that returns a student’s gender, for example


“Female”.An overloaded + operator that will accumulate the year marks of two or more students An overloaded > operator that checks if one student’s year mark is greater than


another students’ An overloaded == that checks a student’s subject code against a given value

1
Expert's answer
2021-11-27T02:33:30-0500
#include<iostream>
using namespace std;


class A
{
public:
A() { cout << "A's constructor called" << endl; }
};


class B
{
public:
B() { cout << "B's constructor called" << endl; }
};


class C: public B, public A // Note the order
{
public:
C() { cout << "C's constructor called" << endl; }
};


int main()
{
	C c;
	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