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
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!!!"<
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
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