Question: In Java: Rectangle Class: 1. Design a class named RightRectangularPrism that extends Rectangle from lab 4 post Lab. This class shall contain: . One double

1. Design a class named RightRectangularPrism that extends Rectangle from lab 4 post Lab. This class shall contain: . One double data field named height that specify the height of the Right Rectangular Prism A no-arg constructor that creates a default Right Rectangular Prism. The default values is 1. A constructor that creates a Right Rectangular Prism with the specified length and width and height. A method named calculateVolumethat returns the volume of this Right Rectangular Prism I A method named calculate SurfaceArea() that returns the surface area. 2. Write a Manager class that creates two Right Rectangular Prism objects-one with length 4, width 5 and height 40 and the other with length 3.5, width 73 and height 35.9. The Manger class shall print the volume and surface area of both Right Rectangular Prism objects. public class Rectangle double width= 40; double length - 4; Rectangle() { width= 40; length= 4; } Rectangle (double w, double 1) { width= w; length= 1; } double getArea() { return width*length; } double getPerimeter() { return 2*(width+length); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
