1. Engineering
  2. Computer Science
  3. need help understanding each part of code and how it...

Question: need help understanding each part of code and how it...

Question details

1. Transform the following UML diagram to a Tv class. TV dhannd: int volumelevel: int The aurreant chanmel (I to 120) of this TV. The arrent volume level (I to 7)of this TV Indicates whether this TV is onv off. on: bool TVO +turnOn0: void turnOfiO void tsetGameinewCharnd: int): void +set Constructs a default TV objedt Turns on this TV. Turns off this TV |Sds anw chama forthis TV. tVolume(newVol umel eve: int): void Sets anewvolume level for this TV Increases the channd number by 1. +channelUpO: void +channelDown0: void +volumeUp0: void +volumeDown): void Dacreases the channel number by 1. Increascs the volume level by 1. Decreases the volume level by 1. This class should include three public data memhers int channel int volumeLeve l and bool n and nine public functions. The function TVO is a constructor.turnOnturns the TV on turnOfO turms the IV off) setChanne int newChannel), sets a new channel for this TV set、 ume(int newVolumeLeve sets anew volume level for th increases t Your class should include a test driver function main0. This main0 should declare two TV ncreases r by one channelDown) decreases he volume level by one. channelDown O decreases the volume level by on objects. One invokes channel functions. The other invokes volume levels. Display channel and volumeLevels for each TV. Make sure your programis working correctly.

need help understanding each part of code and how it pertains to the UML diagram

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution