Question: Rewrite the program using the concept of polymorphism and handling the user input error with exceptions. The new program should produce the same result

Rewrite the program using the concept of polymorphism and handling the user 

Rewrite the program using the concept of polymorphism and handling the user input error with exceptions. The new program should produce the same result as the original program. You are expected to add two additional classes to your program. You may use the inline style to define all the classes. Below are the expected elements that your program should include: a. Definition of the class Three Dimensional object. (7 marks) b. Definition of the class that represents cuboid objects. (10 marks) c. Definition of the class that represents sphere objects. (10 marks) d. Definition for the main function. (19 marks) e. Handling the user input error. (4 marks)

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 Programming Questions!