Question: Answer question Q2(a) - Q2(c) based on the information given in Figure Q2. A class named Rectangle containa: - Two double data flelds named width

Answer question Q2(a) - Q2(c) based on the information given in Figure Q2. A class named Rectangle containa: - Two double data flelds named width and helght that apecity the width and height of the rectangle. - A no-argument constructor that ereates a rectangle with default value 1 for both width and height. - A constructor that createa a rectangle with the specltied width and height. - A method named getArea() that returna the area of rectangle. - A method named getperimeterli that returns the perimeter of rectangle. - A tostring method that returns a string containg heighe, width. area of rectangle, and perimeter of rectangle. Figure Q2 (a) Draw the UML diagram for the elass
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
