Question: Based on the given code for the base header class called TVNetworks ( listed below ) , construct a program that creates two derived header

Based on the given code for the base header class called TVNetworks (listed below), construct a program that creates two derived header classes called SportsNetworks and EntertainmentNetworks and one implementation/test class to develop your object instances. The SportsNetworks header class should contain one unique data attribute called subscribers (long int datatype), while the EntertainmentNetworks header class should also contain one unique data attribute called network_type (string datatype). For both classes, a default constructor, and the appropriate setters and getter methods should be created, respectively. The implementation/test class should create six object instances representing the two derived classes (see table below). You can use initialization to store these values into the respective data attributes.
Official Question: Implementation (C++ Solution): Write the necessary C++ syntax to solve this problem. If you desire to complete the question using an external document (ex. Notepad, Microsoft Word, etc.) feel free to do so. A submission tab via Canvas is provided for you to upload this file (as a .txt or .doc file only).
#include
#ifndef TVNETWORKS_H
#define TVNETWORKS_H
#include
using namespace std;
class TvNetworks {
private:
string name;
int year_of_establishment;
public:
TvNetworks(){
string name ="";
year_of_establishment =0;
}
TvNetworks(string n, int yoe){
name = n;
year_of_establishment = yoe;
}
void setName(string n){
name = n;
}
void setYearofEstablishment(int yoe){
year_of_establishment = yoe;
}
string getName() const {
return name;
}
int getYearofEstablishment() const{
return year_of_establishment;
}
};
#endif

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 Programming Questions!