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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started