Question: Q1 Answer Q1(a)-Q1(b) using Java based on the formulas for calculating the volume of the shapes given in FIGURE Q1. Volume of a cylinder: Volume

 Q1 Answer Q1(a)-Q1(b) using Java based on the formulas for calculating

Q1 Answer Q1(a)-Q1(b) using Java based on the formulas for calculating the volume of the shapes given in FIGURE Q1. Volume of a cylinder: Volume = arah Volume of a cuboid: Volume = length x width x height where nis Math.PI, r is the radius, h is the height FIGURE Q1 (a) Write a class named Volume that has two (2) overloaded static methods for calculating the volume of two (2) 3D shapes: cylinder, and cuboid. Implement the methods in a complete class. (9 marks) (b) Write a class named, Testvolume to use the overloaded static methods written for Q1(a). The class shall display the volume for each of the 3D shapes mentioned in FIGURE Q1. (6 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 Databases Questions!