Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

New Instance Radio Instance: [SerialNumber=1411918066216:43514652, powerState=fa

ID: 3592288 • Letter: N

Question

New Instance

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=false, selectedVolume=0, selectedStation=0.0, selectedBand=null,

amPresets=null,

fmPresets=null,

firstTimeOn=null, lastTimeOn=null, selectedBalance=0, selectedBassLevel=0, selectedTrebleLevel=0]

Turned On

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=true, selectedVolume=5, selectedStation=770.0, selectedBand=AM,

amPresets=[563.0, 1080.0, 773.0, 730.0, 1192.0, 584.0, 608.0, 843.0],

fmPresets=[99.0, 92.0, 101.0, 99.0, 88.0, 103.0, 92.0, 92.0, 92.0, 105.0, 99.0, 93.0],

firstTimeOn=Sun Sep 28 11:27:46 EDT 2014, lastTimeOn=Sun Sep 28 11:27:46 EDT 2014, selectedBalance=0, selectedBassLevel=2, selectedTrebleLevel=3]

Changed Station

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=true, selectedVolume=5, selectedStation=92.3, selectedBand=FM,

amPresets=[563.0, 1080.0, 773.0, 730.0, 1192.0, 584.0, 608.0, 843.0],

fmPresets=[99.0, 92.0, 101.0, 99.0, 88.0, 103.0, 92.0, 92.0, 92.0, 105.0, 99.0, 93.0],

firstTimeOn=Sun Sep 28 11:27:46 EDT 2014, lastTimeOn=Sun Sep 28 11:27:46 EDT 2014, selectedBalance=0, selectedBassLevel=2, selectedTrebleLevel=3]

Assign Preset [1] to + FM

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=true, selectedVolume=5, selectedStation=101.1, selectedBand=FM,

amPresets=[563.0, 1080.0, 773.0, 730.0, 1192.0, 584.0, 608.0, 843.0],

fmPresets=[101.1, 92.0, 101.0, 99.0, 88.0, 103.0, 92.0, 92.0, 92.0, 105.0, 99.0, 93.0],

firstTimeOn=Sun Sep 28 11:27:46 EDT 2014, lastTimeOn=Sun Sep 28 11:27:46 EDT 2014, selectedBalance=0, selectedBassLevel=2, selectedTrebleLevel=3]

Turned Off

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=false, selectedVolume=5, selectedStation=101.1, selectedBand=FM,

amPresets=[563.0, 1080.0, 773.0, 730.0, 1192.0, 584.0, 608.0, 843.0],

fmPresets=[101.1, 92.0, 101.0, 99.0, 88.0, 103.0, 92.0, 92.0, 92.0, 105.0, 99.0, 93.0],

firstTimeOn=Sun Sep 28 11:27:46 EDT 2014, lastTimeOn=Sun Sep 28 11:27:46 EDT 2014, selectedBalance=0, selectedBassLevel=2, selectedTrebleLevel=3]

(2b) UML Class Diagram (10 points)

Provide a simple UML Class diagram that documents the structure and functionality of the Class you implemented.

Class Name

Non-public members (-)

Public Methods (+)

Note: You may hand-draw and scan the image, or use a diagramming tool like NClass or Visio. See Radio Example below:

New Instance

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=false, selectedVolume=0, selectedStation=0.0, selectedBand=null,

amPresets=null,

fmPresets=null,

firstTimeOn=null, lastTimeOn=null, selectedBalance=0, selectedBassLevel=0, selectedTrebleLevel=0]

Turned On

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=true, selectedVolume=5, selectedStation=770.0, selectedBand=AM,

amPresets=[563.0, 1080.0, 773.0, 730.0, 1192.0, 584.0, 608.0, 843.0],

fmPresets=[99.0, 92.0, 101.0, 99.0, 88.0, 103.0, 92.0, 92.0, 92.0, 105.0, 99.0, 93.0],

firstTimeOn=Sun Sep 28 11:27:46 EDT 2014, lastTimeOn=Sun Sep 28 11:27:46 EDT 2014, selectedBalance=0, selectedBassLevel=2, selectedTrebleLevel=3]

Changed Station

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=true, selectedVolume=5, selectedStation=92.3, selectedBand=FM,

amPresets=[563.0, 1080.0, 773.0, 730.0, 1192.0, 584.0, 608.0, 843.0],

fmPresets=[99.0, 92.0, 101.0, 99.0, 88.0, 103.0, 92.0, 92.0, 92.0, 105.0, 99.0, 93.0],

firstTimeOn=Sun Sep 28 11:27:46 EDT 2014, lastTimeOn=Sun Sep 28 11:27:46 EDT 2014, selectedBalance=0, selectedBassLevel=2, selectedTrebleLevel=3]

Assign Preset [1] to + FM

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=true, selectedVolume=5, selectedStation=101.1, selectedBand=FM,

amPresets=[563.0, 1080.0, 773.0, 730.0, 1192.0, 584.0, 608.0, 843.0],

fmPresets=[101.1, 92.0, 101.0, 99.0, 88.0, 103.0, 92.0, 92.0, 92.0, 105.0, 99.0, 93.0],

firstTimeOn=Sun Sep 28 11:27:46 EDT 2014, lastTimeOn=Sun Sep 28 11:27:46 EDT 2014, selectedBalance=0, selectedBassLevel=2, selectedTrebleLevel=3]

Turned Off

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=false, selectedVolume=5, selectedStation=101.1, selectedBand=FM,

amPresets=[563.0, 1080.0, 773.0, 730.0, 1192.0, 584.0, 608.0, 843.0],

fmPresets=[101.1, 92.0, 101.0, 99.0, 88.0, 103.0, 92.0, 92.0, 92.0, 105.0, 99.0, 93.0],

firstTimeOn=Sun Sep 28 11:27:46 EDT 2014, lastTimeOn=Sun Sep 28 11:27:46 EDT 2014, selectedBalance=0, selectedBassLevel=2, selectedTrebleLevel=3]

Model a physical entity as a Java Class (70 points) focus on Encapsulation This is an Object Modeling/Programming exercise - albeit around 1 (maybe 2) Object(s). Using the Radio Class implementation provided as a point of reference, thinkof a common (or maybe, not so common) physical device or appliance that's worthy of modeling as an Object Consider the following a. The basic operations/functionality of your device/appliance become public methods of the implementing Class (e.g., on, off, go, start, stop, ...) The internal structure (or how you envision the internal structure) of your device/appliance become the data members of the implementing Class This would include the internal piece-parts of the device and well as "state components". For example, modeling a bread toaster might require a "heat coil" as well as a "power on/off" indicator b. c. In the spirit of modularity, reusability, etc., private/protected methods can and should be used to implement sub-tasks performed by public methods In addition to Class members supporting (a) (b) (c) above, you also need to implement Either a public void main (String [t "launch" Class whose only job will be to method or a second Create an instance of your modeled Class o Invoke a sequence of methods on that instance that demonstrates the functionality and basic usefulness of what you built. o A "string tostrin)"method - allowing you to display the state' of the Object Instancee What do we mean by the state of the Instance? The collective value of all data members 'at a moment in time' is considered the in stance's state That's a valid definition of state. but for this lab, customize the Class tostring() method to display values of data members that are considered significant to the device/application's operation Note: Refer to the Radio Class' tostring() andmain () methods as a guide. Also refer to the Radio's execution outputbelow - showing thata single instance has been created, and taken through a series of operations (method invocations). At critical points, a "toString" representation of the instance's state is displayed to the console using system.out.println )orthe like

Explanation / Answer

New Instance

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=false, selectedVolume=0, selectedStation=0.0, selectedBand=null,

amPresets=null,

fmPresets=null,

firstTimeOn=null, lastTimeOn=null, selectedBalance=0, selectedBassLevel=0, selectedTrebleLevel=0]

Turned On

Radio Instance: [SerialNumber=1411918066216:43514652, powerState=true, selectedVolume=5, selectedStation=770.0, selectedBand=AM,

amPresets=[563.0, 1080.0, 773.0, 730.0, 1192.0, 584.0, 608.0, 843.0],

fmPresets=[99.0, 92.0, 101.0, 99.0, 88.0, 103.0, 92.0, 92.0, 92.0, 105.0, 99.0, 93.0],

firstTimeOn=Sun Sep 28 11:27:46 EDT 2014, lastTimeOn=Sun Sep 28 11:27:46 EDT 2014, selectedBalance=0, selectedBassLevel=2, selectedTrebleLevel=3]