Framing the Project (real-world): You will be creating an object that represents an FM car radio. You will be simulating the various controls of the radio such as volume control, tuning to various stations, preset stations, and turning it on and off. Specifically the radio will have:
When the radio has been used and is turned off, the next time the radio is turned on:
Program Design Class Name: FMRadio() Fields Constants: final double MAX_FREQUENCY = 108.0 final double MIN_FREQUENCY = 87.5 final int MAX_VOLUME = 20 final int MIN_VOLUME = 0 Instance variables (visibility for all instance variables is private): isOn, type: boolean
isMuted, type: boolean
mutedVolume, type: int
currentStation, type: double
volume, type: int
presetStation[ ], type: double array
Constructor:
Methods: Private: resetRadio()
initPresetStations()
Public: displaySettings()
increaseVolume()
decreaseVolume()
setPresetStation(int presetNumber)
increaseFrequency()
decreaseFrequency()
changeStation(int preset)
changeStation(double station)
seekUp()
seekDown()
muteVolume()
powerSwitch()
|
05.0 Java Assignments > Java Unit 3 Objects >