Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a new project called PreLab09 with two separate classes called TestCylinder and TestRectangle. The TestRectangle.java file contains the TestRectangle class which includes the main
Create a new project called PreLab09 with two separate classes called TestCylinder and TestRectangle. The TestRectangle.java file contains the TestRectangle class which includes the main method, and another class called SimpleRectangle with instance variables for length and width and two constructors (one with arguments, one with no arguments), and instance methods that return the area, perimeter, and diagonal for rectangles. The TestCylinder.java file contains the TestCylinder class which includes the main method, and another class called SimpleCylinder with instance variables for radius and height, and two constructors (one with arguments, one with no arguments), and instance methods that get the surface area and get the volume for cylinders. Use length =10 and width=20 for the rectangle, and radius =10 and height=30 for the cylinder. You can right click on eachs source code and select run file to test each file.
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