Question: Rectangle Class Draw the UML diagram for the class and then implement the class. Make sure that your constructors and mutator methods can check the

Rectangle Class  Rectangle Class Draw the UML diagram for the class and then

Draw the UML diagram for the class and then implement the class. Make sure that your constructors and mutator methods can check the new length and width to make sure onl y positive values can be used in your rectangle objects, otherwise print out error message to the user Create your own project in Eclipse, add a test class with main method as usual first. Then add another new class called Rectangle without the main method in the same project. Now you should have two class files in your project. Implement the Rectangle class first. In your test class main method, creates two Rectangle objects- one with width 4 and length 40 and the other with width 3.5 and length 35.9. Display the width, length, area, and perimeter of each rectangle in this order. Bonus: Please add a class called Cube to present a cube to your project. The class contains: . Three private double variables, length, width, and height .A no-arg constructor that creates a default cube A constructor with three parameters that creates a cube with specific length, width, and height The accessors and mutators methods . A method to compute the area of the cube define at least two cube objects in your test program and use all the methods that you define in your Cube class

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!