Question: What is the correct coding for this Objects and Constructors Define a class of rectangles. Design a class named Rectangle to represent a rectangle. The

What is the correct coding for this  What is the correct coding for this Objects and Constructors Define
a class of rectangles. Design a class named Rectangle to represent a

Objects and Constructors Define a class of rectangles. Design a class named Rectangle to represent a rectangle. The class contains: Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1.0 for both width and height. A no-arg constructor that creates a default rectangle. A constructor that creates a rectangle with a specified width and height A method named getArea0 that returns the area of a rectangle. > A method named getPerimeterO that returns the perimeter. Requirements: 1. Draw the UML of the Rectangle class. 2. Implement this class. 3. Write a test program with a main method that should do the following tasks: . Create the first rectangle using the no-arg constructor Create a second rectangle using the constructor's arguments to set the width to 4.0 and the height to 40.0. Print out the area of the first rectangle. Print out the perimeter of the second rectangle. Please note: You must finish this work by the end of the lab period. If you do not finish, please just submit what you have at the end of the lab. Submission: Submit the UML in a word or PDF file and program in a java file in folio using the dropbox folder Lab 9

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!