Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need help understanding each part of code and how it pertains to the UML diagram 1. Transform the following UML diagram to a Tv class.
need help understanding each part of code and how it pertains to the UML diagram
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 correctlyStep 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