Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Discuss the four components of language.

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago