Class CassettePlayer

java.lang.Object
solution.CassettePlayer

public class CassettePlayer extends Object
CassettePlayer that you can load a cassette into and record and play messages.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Unloads the cassette from the CassettePlayer.
    boolean
    Checks if there is a loaded cassette.
    void
    If a cassette is loaded, prints out the message.
    void
    If a cassette is loaded, prints out the message in all uppercase.
    void
    If a cassette is loaded, prints out the message in reverse.
    void
    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.
    void
    Loads the passed in cassette.
    void
    Prints out the status of the CassettePlayer (Loaded or Not Loaded).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CassettePlayer

      public CassettePlayer()
  • Method Details

    • setLoadedCassette

      public void setLoadedCassette(TapeCassette loadedCassette)
      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

      public void recordMsg(String msg)
      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.