Answered step by step
Verified Expert Solution
Link Copied!

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 TV_Test class as described below in C ++
1. 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 functions/methods.
Make one of these variables a string which contains the TV Model (such as "LG OLED65V2PUA").
2. Create public methods to modify the variables above.
3. 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.
4. Create a display() method that will display the values of all the variables for the TV.
5. Create a TV_Test class.
6. Make 2 TV objects.
7. 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.
8. 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 TV's 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions