Class CassettePlayer
java.lang.Object
solution.CassettePlayer
CassettePlayer that you can load a cassette into and record and play messages.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidUnloads the cassette from the CassettePlayer.booleanisLoaded()Checks if there is a loaded cassette.voidplayMsg()If a cassette is loaded, prints out the message.voidIf a cassette is loaded, prints out the message in all uppercase.voidIf a cassette is loaded, prints out the message in reverse.voidRecords a message to the loaded cassette if one is loaded Also displays that the Cassette player is recording and the message that was recorded.voidsetLoadedCassette(TapeCassette loadedCassette) Loads the passed in cassette.voidstatus()Prints out the status of the CassettePlayer (Loaded or Not Loaded).
-
Constructor Details
-
CassettePlayer
public CassettePlayer()
-
-
Method Details
-
setLoadedCassette
Loads the passed in cassette.- Parameters:
loadedCassette- TapeCassette to load.
-
ejectCassette
public void ejectCassette()Unloads the cassette from the CassettePlayer. -
isLoaded
public boolean isLoaded()Checks if there is a loaded cassette.- Returns:
- True if a cassette is loaded.
-
status
public void status()Prints out the status of the CassettePlayer (Loaded or Not Loaded). See sample output for the formatting. -
recordMsg
Records a message to the loaded cassette if one is loaded Also displays that the Cassette player is recording and the message that was recorded. See sample output for the formatting.- Parameters:
msg- Message to record.
-
playMsg
public void playMsg()If a cassette is loaded, prints out the message. See the sample output for the formatting. -
playMsgLoud
public void playMsgLoud()If a cassette is loaded, prints out the message in all uppercase. See the sample output for the formatting. -
playMsgReverse
public void playMsgReverse()If a cassette is loaded, prints out the message in reverse. See the sample output for the formatting.
-