Question: Java Program for OOP Exercise #1: [20 marks] RADIO SET Problem Statement: Each radio set is an object with attributes (manufacturer, current channel, current volume

Java Program for OOP
 Java Program for OOP Exercise #1: [20 marks] RADIO SET Problem
Statement: Each radio set is an object with attributes (manufacturer, current channel,
current volume level, power on or off, recording on or off, number

Exercise #1: [20 marks] RADIO SET Problem Statement: Each radio set is an object with attributes (manufacturer, current channel, current volume level, power on or off, recording on or off, number of recordings) and behaviors (current channel, channel up, channel down, adjust volume, turn on, turn off, recording on, recording off, total number of In this exercise, a Radio class which implements functions of a radio set with the aforementioned attributes and behaviors is given below but not complete. Do the following and show your work to the Lab Instructor Fill in the missing part (marked as red color) in the following "Radio.java" file. class Radio int channel-1:W Default chamel is int velumeLevel-1N Default volume level is boolean on alse,By defauht Radio is off boolean rec- fase V By default recoeding is off String manufacturerBy default monufacturer is nullempty int totalNumberOfRecordings-, By default total sumber of recoedings are 0 Write a zero argument constructor publie void tumOn 1WWrite a code that sets the instant variable "on" as true and print that "Radio is on public void tunot 1/Weine a code that sets the instant variable "on" as false and peint that "Radio is olf" public vold recOn Erue Sydem.out printlal Recoding has been started"k public void recofto t Write acode thait scts the instant variable "roc" as Ealse and print that "rocceding has stopped Wrile a method that takes a String named "New Manufacturer and sets i to the instant ariable man factuer Write a mcthod that retuns current Manufacturer of the radio Wehe a method that returns Total Number of Recordings void sctChannc int newChannel publie void recOaD Write a code that sets the instant variablerec"s alse and prin ha "ecoingha Write a method that takes a String named "New Manofactuner" and scts i to the nan Wrine a method that returns current Manfacturer of the radio Write a method thait returms Total Number of Recondings been stopped vriable "manufacturer public void setChannel int newChanel if (on && newChannel1&& new Channel -120 V Set the instant variable "channe" and print Radio channel has been set to new hannel" channel public void setVolumelint newVolumelevel if (on && new VolumeLevel1&&newVlumelevel7 {//Setthe instant variable"volume" andprio volume hm sd to sew Wolume"+ volume ) pulie void channelUpo if (on && chanmel120 channel System.out.printin"channel is set to one level up and cument channel is channeli publie void channelDown if (on && channel channel Systom.out printin"channel is set to one level down and cument chamnel ischanel public veid velumeUp) t if(oe && volumelevel 1 W increase the valae of volume by 1 and printVlme is set to one level p+ solume pulie void volumeDown { if(on && volumeLevel ) Systom out printind"voleme is set to one level down and curment volume is volumel evelk 2) Write a Java test class named "RadioTestjava" that do the following: a. Sets the radio manufacture as "Huawei" b. Sets radio on c. Sets radio channel to 30 d. Start the recording e. Sets radio volume to 3 f. Increase the volume g. Increase the volume again h. Stop the recording i. Increase channel to one level up j. Show total number of recordings k. Set radio off A sample run: manufacturer is Huawei DIO channel has been set to 30 ecoding has been started adio Volume has been set to 3 volume is set to one level up and current volume is 4 volume is set to one level up and current volume is 5 Recoding has been stopped channel is set to one level up and current channel is 31 Total number of recordings are 1 RADIO is off

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!