Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Step: 3

blur-text-image

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

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

Students also viewed these Databases questions

Question

Q.No.1 Explain Large scale map ? Q.No.2 Explain small scale map ?

Answered: 1 week ago

Question

1. Signs and symbols of the map Briefly by box ?

Answered: 1 week ago

Question

=+What is the most that you should pay to complete development?

Answered: 1 week ago