Question
This exercise has the purpose first to get you to implement the Shape, Point, Circle and Cylinder .you should also design and implement the following
This exercise has the purpose first to get you to implement the Shape, Point, Circle and Cylinder .you should also design and implement the following shape classes exploiting inheritance: Sphere, Rectangle, Square and Cube. Having implemented these , you should write a which gets input from the user/keyboard to create an instance of any one of these. The user should be able to create as many of these shapes and s/he wants. The menu should also allow the user to print out the created objects, either selecting a particular one or printing all of them. The user should also be allowed to remove/delete an existing shape from the list. Finally, the user should be allowed to modify a particular shape. The program should print the objects it keeps by using only the Shape getName(), toString(), getArea() and getVolume() methods, i.e. treating all these objects "polymorphically" as "shapes". Note that modifying a shape cannot be done polymorphically, specific functions will be required to modify each type of shape. The program should deal gracefully with incorrect type of arguments through checks and exceptions.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started