Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ programming For this assignment please complete the following exercises. In addition to the requirements stated in these exercises for any classes that you create
C++ programming
For this assignment please complete the following exercises. In addition to the requirements stated in these exercises for any classes that you create you should also create a class diagram using UML.
Create a Television class.
- The attributes for the Television are:
- Manufacturer
- Model
- Screen Size
- Resolution
- Price
- Serial Number
- Power (i.e. on or off)
- Channel
- Volume
- Two other attributes of your own choosing
- Create a constructor for the class that receives Manufacturer, Model, Screen Size, Resolution, Price, and Serial Number. The constructor should set the attributes provided and provide default values for all other attributes. Include the attributes you provided as appropriate.
- Create an appropriate destructor.
- Provide separate Accessor/Get Methods that will return the values of the various attributes.
- Provide separate Mutator/Set Methods that will allow a user to turn the tv on/off, change the channel, and set the volume.
- Provide appropriate Accessor/Mutator methods for the attributes you provided.
Create a main program that utilizes the Television class
- Allow the user to create multiple televisions. Prompt the user for the number of televisions to create.
- For each television:
- Prompt the user for the Manufacturer, Model, Screen Size, Resolution, Price, and Serial Number (and any fixed attributes you provided). Ensure your program validates the information.
- Create an object for the Television.
- Using the Accessor Methods, display the Television's information (manufacturer, model, etc.).
- Allow the user to change the television's state (on/off, channel, volume, etc.). Validate any input before calling the appropriate functions.
- Allow the user to change any of the attributes you created (appropriately)
- Display the list of Television's and their information.
Be sure to include in your program:
- An appropriate header comment and annotation,
- Input validation of any values provided by the user.
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