You've just started working for a boutique electronic company and you've been tasked with modeling their new line of record players.
The company's most basic product line is simple turntables that can support rpm speeds of 33, 45, and 78 Create a TurnTable class with these properties and methods:
- A double called
CurrentSpeed - A boolean property called
IsPlayingthat tracks whether the motor is running
- An
Playmethod that sets theIsPlayingproperty totrue - A
Stopmethod that sets theIsPlayingproperty tofalse
The company has decided to start a line of integrated turntables. They'd like a new product that has speakers built right into the record players This product has the same turntable built in, so create a subclass of Turntable with these additional properties and Methods:
- An int called
Volume
- A method called
VolumeUpthat incrementsVolumeby 1 - A method called
VolumeDownthat decrementsVolumeby 1
Research has shown that these all-in-one record players are a big hit. The company wants to introduce a new product. It still has the turntable and speakers, but this time they want to have a built in AM/FM radio. Create a subclass of your previous class with the following properties and methods:
- A double called
CurrentFrequency - A List of doubles called
FavoriteStations
- A method called
AddFavoritethat adds a new station toFavoriteStations - A method called
RemoveFavoritethat removes a station fromFavoriteStations
These all-in-one products are selling like hotcakes! But R&D has determined that customers are also wanting built-in CD players. Create yet another subclass that has the following properties and methods:
- An integer value called
TotalTracks - An integer value called
CurrentTrack
- A method called
NextTrackthat incrementsCurrentTrackby 1 - A method called
PreviousTrackthat decrementsCurrentTrackby 1
Turns out a lot of people still listen to CDs! But those same customers don't always listen to vinyl. So the company would like to release a product that is just a CD player with built-in speakers. Create a class that has a CD player and speakers but doesn't have the radio or turntable.