Question: I need help creating a TV class/object. It should have a maximum of 10 channels and display their specific information. I've written a little bit

I need help creating a TV class/object. It should have a maximum of 10 channels and display their specific information. I've written a little bit of code but am unable to actually call to the function and print out the information for a specific channel. Near the end you'll find my attempt at the TV class. Could someone help me with the TV object and calling it in my main function? I'm not sure how to fix my private and public definitions. I believe my struggle is mainly with creating the object not manipulating it.

#include #include #include

using namespace std;

int main(int argc, char** argv) { int stat; int vol = 10; int select; while(1){ //while loop for user selection cout << "TV is on right now!!!"<> stat; switch(stat){ case 1: //user wants to turn off TV cout << "TV is off right now!!!"<> select; switch(select) { case 1: cout << "You are watching: " << tv[0]<< endl; } } }

return 0; }

class TV { public: TV(int a){ switch(a){ case 1: cout << "Channel 1 - ESPN"; break; case 2: cout << "Channel 2 - World Travel"; break; case 3: cout << "Channel 3 - Oscar Awards"; break; case 4: cout << "Channel 4 - Business"; break; case 5: cout << "Channel 5 - World News"; break; case 6: cout << "Channel 6 - Local Weather"; break; case 7: cout << "Channel 7 - Comedy Central"; break; case 8: cout << "Channel 8 - Game Show"; break; case 9: cout << "Channel 9 - CNN"; break; case 10: cout << "Channel 10 - Movie : Push"; break; } } private: TV();

};

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!