Question: C++11 1. This problem requires that you write a class definition, and implement two of its functions. Given the following class definition: class Base {

C++11

1. This problem requires that you write a class definition, and implement two of its functions. Given the following class definition:

class Base {

public:

Base();

Base(char y);

char getLetter() const;

void setLetter(char c);

private:

char letter;

};

Derive a class from Base called Derived. It must have the following: Default Constructor Constructor that takes a single char Constructor that takes a single char and one int An overloaded insertion operator A new private data member int called num Write out the class definition, and implement the constructor that takes two parameters (use the initialization section), and the insertion operator. The insertion must print the Derived object in the following way: (char, int), with the parentheses.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!