Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Define a TV class and a TV _ Test class as described below in C + + 1 . Create a TV class that has
Define a TV class and a TVTest class as described below in C
Create a TV class that has private variables for all the things a TV should know.
Remember what we talked about in class?
A Class KNOWS stuff and DOES stuff.
The stuff it KNOWS are the variables and the stuff it DOES are the functionsmethods
Make one of these variables a string which contains the TV Model such as LG OLEDVPUA"
Create public methods to modify the variables above.
Create multiple overloaded constructors for the TV class that range from receiving no arguments to receiving arguments for all the variables.
If a constructor with no arguments is called, it must choose default values for the above variables. Make the constructor with no arguments call a constructors that does accept arguments and provide default values.
Create a display method that will display the values of all the variables for the TV
Create a TVTest class.
Make TV objects.
Call the various methods for these TV objects. For example change channels and volume. Make each TV object have a different channel and volume level.
Call the display method for each TV object.
Extra Credit. Can you come up with a static variable that keeps track of the model names of all the TVs created so far?
Each time a new TV object is created this static variable should expand by adding the model name of that tv to it's list.
Create a static method called showAllTVs that can be called which will display all the model names of the TV objects created so far.
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