Q#2: Create a class named “Rectangle” having length and width as attribute. There should be behaviors to set the values of length and width (individually and collectively), and get their values...


Q#2: Create a class named “Rectangle” having length and width as attribute. There should be behaviors to set the values of length and width (individually and collectively), and get their values individually. There should also behavior to display the perimeters and area of the rectangle.

Create another class named as Main which have two objects of Rectangle (r1, r2) having length (3.2, 20) and width (4.5, 36) respectively. Also display the length, width, perimeter and area of both rectangles.



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here