CMSC 335 Project 1
CMSC 335 Project 1
Overview
In the project you will use Java Inheritance to create a series of related classes with a “Shape” theme.
Before completing this exercise, be sure to review and try the Java class and inheritance examples and
materials found on the Oracle Java Tutorials:
https://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html
Note: Be sure to review is-a and has-a class relationships prior to starting this exercise as well.
Assignment Details
Design, implement and test a Java class Inheritance hierarchy that would satisfy the following is-a and
has-a relationships:
• A Shape is an object
• A TwoDimensionalShape is a Shape
• A ThreeDimensionalShape is a Shape
• A Circle is a TwoDimensionalShape
• A Square is a TwoDimensionalShape
• A Triangle is a TwoDimensionalShape
• A Rectangle is a TwoDimensionalShape
• A Sphere is a ThreeDimensionalShape
• A Cube is a ThreeDimensionalShape
• A Cone is a ThreeDimensionalShape
• A Cylinder is a ThreeDimensionalShape
• A Torus is a ThreeDimensionalShape
• A Shape has a NumberofDimensions
• A TwoDimensionalShape has an area
• A ThreeDimensionalShape has a volume
Note you should fill in additional methods and variables that make sense for each of the classes. Also
some assumptions about shape types is appropriate and should be documented in the code and
documents submitted. For example, type of triangle …
Create a command line driven menu that allows a user to construct each of the TwoDimensional and
ThreeDimensional Shape subclasses. The menu should continue to loop prompting for a specific class
and then prompt for appropriate input parameters. The values returned should be the volume or area
as appropriate to the shape. Error checks should be in developed to make sure appropriate menu items
and types of data were input and prompt the user to enter to correct data. An option to exit the
program should be available as well that will provide an appropriate Thank you message along with the
current date and time.
1. Construct a Circle
2. Construct a Rectangle
3. Construct a Square
4. Construct a Triangle
5. Construct a Sphere
6. Construct a Cube
7. Construct a Cone
8. Construct a Cylinder
9. Construct a Torus
10. Exit the program
9.5
1. Construct a Circle
2. Construct a Rectangle
3. Construct a Square
4. Construct a Triangle
5. Construct a Sphere
6. Construct a Cube
7. Construct a Cone
8. Construct a Cylinder
9. Construct a Torus
10. Exit the program
10
Submission Requirements:
1. Submit all of your Java source files (each class should be in a separate .java file). These files
should be zipped and submitted with the documentation.
2. UML class diagram showing the type of the class relationships.
3. Developer’s guide describing how to compile and execute the program. The guide should
include a comprehensive test plan that includes evidence of testing each component of the
menu with screen captures and descriptions supporting each test. Documentation includes
Lessons learned.
Your compressed zip file should be submitted to the Project 1 folder as directed.
Grading Rubric:
Attribute Meets
Design 45 points
Designs a Java class Inheritance hierarchy that would satisfy the following is-
a and has-a relationships:
• A Shape is an object
• A TwoDimensionalShape is a Shape
• A ThreeDimensionalShape is a Shape
• A Circle is a TwoDimensionalShape
• A Square is a TwoDimensionalShape
• A Triangle is a TwoDimensionalShape
• A Rectangle is a TwoDimensionalShape
• A Sphere is a ThreeDimensionalShape
• A Cube is a ThreeDimensionalShape
• A Cone is a ThreeDimensionalShape
• A Cylinder is a ThreeDimensionalShape
• A Torus is a ThreeDimensionalShape
• A Shape has a NumberofDimensions
• A TwoDimensionalShape has an area
• A ThreeDimensionalShape has a volume
Functionality 85 points
Contains no coding errors.
The menu should continue to loop prompting for a specific class and then
prompt for appropriate input parameters. The values returned should be the
volume or area as appropriate to the shape.
An option to exit the program should be available as well that will provide an
appropriate Thank you message along with the current date and time
Test Data and 45 points
Test Plan Tests the application using multiple and varied test cases.
Submission includes Java source code files, Data files used to test your
program, Configuration files used.
Documentation includes a UML class diagram showing the type of the class
relationships.
Documentation includes a test plan with sample input and expected results,
test data and results and screen snapshots of some of your test cases.
All figures, tables, equations, and references should be properly labeled and
formatted using APA style.
Any submissions that do not represent work originating from the student will be submitted to the
Dean’s office and evaluated for possible academic integrity violations and sanctions.