Question: with java +this is the output tv1's channel is 30 tv1's volume is 3 Run: tv2's channel is 3 tv2's volume is 2 Consider the

tv1's channel is 30 tv1's volume is 3 Run: tv2's channel is 3 tv2's volume is 2 Consider the following UML diagram of the TV class: Question 4.1: Write a TV class (without main method) and declare its instance variables. The Default channel is 1 , the default volume level is 1 and the TV is off. 1. The turnOn method turns on this TV. 2. The turnoff method turns off this TV. 3. The setChannel method sets the new channel if the TV is on and the new channel is between 1 and 120. 4. The setVolume method sets the new volume if the TV is on and the new volume is between 1 and 7. 5. The channelUp method increases the channel number by 1 if the TV is on and the channel is less than 120. 6. The channelDown method decreases the channel number by 1 if the TV is on and the channel is greater than 1. 7. The volumeUp method increases the volume number by 1 if the TV is on and the channel is less than 7. 8. The volumeDown method decreases the volume number by 1 if the TV is on and the volume is greater than 1 . 9. In the main class TestTV: Question 4.2: Modify the code in order to initialize the first tv by the same values (channel =30 and volumeLevel =3 when creating the tv1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
