#include #include #include using namespace std; class channelGuideType { private: int channelNumber; string chAbbrev; string chFullName; public: void setChannelNumber(int newNumber) { channelNumber = newNumber; } void setChAbbrev(string newAbbrev) { chAbbrev = newAbbrev; } void setChFullName(string newFullName) { chFullName = newFullName; } int getChannelNumber() { return channelNumber; } string getChAbbrev() { return chAbbrev; } string getChFullName() { return chFullName; } }; // This is a Global Variable!!! void setChannelNumber(channelGuideType &chGuide){ int inputNumber; cout << "Enter the new channel number: "; cin >> inputNumber; chGuide.setChannelNumber(inputNumber); } int main() { channelGuideType *chArray[10]; chArray[0] = new channelGuideType(); setChannelNumber(*chArray[0]); chArray[0]->setChAbbrev("TWC"); chArray[0]->setChFullName("The Weather Channel"); cout << "The channel number is " << chArray[0]->getChannelNumber() << endl; cout << "The channel Abbreviation is " << chArray[0]->getChAbbrev() << endl; cout << "The channel full name is " << chArray[0]->getChFullName() << endl; chArray[1] = new channelGuideType(); setChannelNumber(*chArray[1]); chArray[1]->setChAbbrev("TSC"); chArray[1]->setChFullName("The Science Channel"); cout << "The channel number is " << chArray[1]->getChannelNumber() << endl; cout << "The channel Abbreviation is " << chArray[1]->getChAbbrev() << endl; cout << "The channel full name is " << chArray[1]->getChFullName() << endl; return 0; }