Consider a television set. Each TV is an object with fields (variables), such as, channel, volume level,
Question:
Consider a television set. Each TV is an object with fields (variables), such as, channel, volume level, power, size, and type. It has also some functionalities, such as, set channels (1-120), change channels (up/down), set volume (1-50), change volume (up/down), turn on/off, and set mode (mute/unmute) etc.,. As such, you can use a class to model (describe) a TV set.
Things to do in this assignment:
1. Draw a UML diagram for the TV class. The UML diagram must include all the necessary fields and methods.
2. Declare and define the TV class. In the class,
A. Declare all the necessary fields.
B. Declare and define the constructor methods (at least two) to initialize the fields.
C. Declare and define all the necessary Accessor methods to read the fields.
D. Declare and define all the Mutator methods to set all the fields.
3. Create a Tester class to create a TV object out of the TV class defined as above. In the Tester class,
A. You must add necessary methods so that user can input their data to work with the TV, such as, making the TV On/Off, setting a channel, set a specific volume etc., your program should also display the current settings of the TV.
B. The Tester class must have multiple methods.
Advertising & IMC Principles & Practice
ISBN: 978-0132163644
9th Edition
Authors: Sandra Moriarty, Nancy Mitchell, William Wells