Question: Code required in Java Virtual Dice Throwing and Point-Circle-Cylinder Inheritance and Polymorphism a program exercising inheritance and polymorphism. The program has the purpose to get

Code required in Java

Code required in Java Virtual Dice Throwing and Point-Circle-Cylinder Inheritance and Polymorphism

Virtual Dice Throwing and Point-Circle-Cylinder Inheritance and Polymorphism a program exercising inheritance and polymorphism. The program has the purpose to get you to implement the Point, Circle and Cylinder classes as in the lecture notes in order to get to understand better, assimilate and exercise the inheritance features taught in the lectures. You should implement those three classes using inheritance, with Shape being an interface instead of an abstract class. Although you can simply copy the code from the notes, it would be certainly more beneficial to write the code yourselves by looking at the notes in order to realise how object-oriented features related to inheritance are exercised and understand / assimilate the relevant principles. Having implemented these classes, you should write a ShapeTest program (or whatever you call it) which gets input from the user to create a Point, Circle or Cylinder accordingly. The user should be able to create as many of these shapes and s/he wants. The menu should also allow the user to printout the created objects. Optionally, the user may be allowed to remove an existing shape from the list. The program should print the objects it keeps in a simple array (NOT ArrayList) using the Shape getName(), toString(), getArea() and getVolume() methods, i.e. treating these objects polymorphically, in a similar fashion to the polymorphic test program in the notes. The program should deal gracefully with incorrect number and type of arguments through checks and exceptions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!