Week 6 Lab Assignment
Overview
For this assignment, you will generate a UML class diagram for two classes based on their JavaDoc. You will then implement those classes. The classes represent a cassette player and tape cassettes. You will also implement portions of a driver that perform various actions such a loading and ejecting the player with different cassettes and recording and playing messages. This Lab will give you practice implementing classes based on JavaDoc and creating and using instances of classes.
Additionally, you will learn how to use GitHub and git version control to submit your solution. You will also configure Checkstyle for IntelliJ.
Pre-Lab (DUE BEFORE LAB)
As part of the pre-lab activity you will go through the linked instructions that show you how to access the GitHub repository link provided by your instructor. Use this link to clone the repository into an IntelliJ project.
Additionally, you must install and configure Checkstyle for IntelliJ. The following links provide background to why Checkstyle and coding standards are important as well as instructions for installing Checkstyle in IntelliJ.
- What is the MSOE Coding Standard?
- What is CheckStyle?
- How to install CheckStyle in IntelliJ
The full MSOE Coding Standard can be found on our Coding Standards Page. Please be aware the videos are a few years old, and the link to the CheckStyle configuration file has changed. The correct configuration can be found at the bottom of the Coding Standards page, along with instructions on how to install CheckStyle.
What Must Be Done by the Pre-lab Due Date?
- Provide your instructor with your GitHub username.
- Find the link to your repository in the Repository Access Page provided by your instructor.
- Clone the project, opening it in IntelliJ
- Rename the
usernamepackage to your username - Commit the changes
- Download and install CheckStyle as a plug-in for IntelliJ
- Configure CheckStyle for all new Projects
Assignment
TapeCassette and CassettePlayer Class
Use the provided JavaDoc to create UML class diagrams for
TapeCassette and CassettePlayer. Show them to your instructor during lab. Once you
receive feedback, implement both classes with functionality that conforms to the documentation.
AntiqueAppliances Class
Within the repository is a partially implemented driver class called AntiqueAppliances. This
driver simulates you as the owner of an antique appliance store testing the functionality of a cassette
player and cassettes. Within the driver are various TODOs that you must implement.
Sample Program Interaction
Once you have implemented the classes specified in the JavaDoc and completed the driver, your code should produce the following output.
You are the owner of Antique Appliances and have come across a cassette player
and two blank cassettes. Before putting the items up for sale, you want to check
that the player can record and play messages on the cassettes.
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Not Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
3
Error, no cassette loaded.
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Not Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
4
Error, no cassette loaded.
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Not Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
1
Which cassette would you like to load.
1 -> Cassette 1
2 -> Cassette 2
1
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
4
How would you like to play the message?
1 -> Normal
2 -> Loud
3 -> Reverse
1
--------------------
|Playing (Normal): |
| |
--------------------
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
3
What message would you like to record?
The max message length is 15.
superfunkiecalifragilistic
--------------------
|Recording: |
|superfunkiecali |
--------------------
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
4
How would you like to play the message?
1 -> Normal
2 -> Loud
3 -> Reverse
2
--------------------
|Playing (Loud): |
|SUPERFUNKIECALI |
--------------------
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
1
Error, cassette already loaded.
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
2
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Not Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
1
Which cassette would you like to load.
1 -> Cassette 1
2 -> Cassette 2
2
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
3
What message would you like to record?
The max message length is 15.
Hello World!
--------------------
|Recording: |
|Hello World! |
--------------------
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
4
How would you like to play the message?
1 -> Normal
2 -> Loud
3 -> Reverse
3
--------------------
|Playing (Reverse):|
|!dlroW olleH |
--------------------
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
2
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Not Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
1
Which cassette would you like to load.
1 -> Cassette 1
2 -> Cassette 2
1
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
4
How would you like to play the message?
1 -> Normal
2 -> Loud
3 -> Reverse
1
--------------------
|Playing (Normal): |
|superfunkiecali |
--------------------
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
3
What message would you like to record?
The max message length is 15.
How are you?
--------------------
|Recording: |
|How are you? |
--------------------
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
4
How would you like to play the message?
1 -> Normal
2 -> Loud
3 -> Reverse
2
--------------------
|Playing (Loud): |
|HOW ARE YOU? |
--------------------
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
2
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Not Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
1
Which cassette would you like to load.
1 -> Cassette 1
2 -> Cassette 2
2
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
4
How would you like to play the message?
1 -> Normal
2 -> Loud
3 -> Reverse
1
--------------------
|Playing (Normal): |
|Hello World! |
--------------------
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
2
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Not Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
1
Which cassette would you like to load.
1 -> Cassette 1
2 -> Cassette 2
1
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
4
How would you like to play the message?
1 -> Normal
2 -> Loud
3 -> Reverse
1
--------------------
|Playing (Normal): |
|How are you? |
--------------------
What would you like to do with the Cassette Player?
--------------------
|Status: |
|Loaded |
--------------------
1 -> Load cassette
2 -> Eject cassette
3 -> Record message
4 -> Play message
q -> quit
q
QuittingAcknowledgement
This laboratory assignment was developed by Drs. Adela Velez and Lois Kailhofer.