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
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.
Step by Step Solution
3.46 Rating (146 Votes )
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