Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Java: Rectangle Class: 1. Design a class named RightRectangularPrism that extends Rectangle from lab 4 post Lab. This class shall contain: . One double
In Java:
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); } } Rectangle Class:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started