Question: User - Defined Classes and Object - OrientedProgrammingTask 1 : Define the Rectangle ClassCreate a new file named Rectangle.m . Define a class Rectangle with

User-Defined Classes and Object-OrientedProgrammingTask 1: Define the Rectangle ClassCreate a new file named Rectangle.m.Define a class Rectangle with two properties: Width and Length.Define a constructor method to initialize Width and Length with provided values or to defaultthem to zero if no values are given.Task 2: Add Methods to the Rectangle ClassDefine a method to calculate the area of the rectangle. This method should return the result.Define a method to calculate the perimeter of the rectangle. This method should return theresult.Task 3: Test the Rectangle ClassInstantiate a Rectangle object named rect1 with specific width and length values.Test the area and perimeter methods by calling them on the rect1 object.Display the results to verify correctness.Task 4: Experiment with Multiple ObjectsCreate additional Rectangle objects with different dimensions.Calculate and display the area and perimeter of each rectangle to understand how objectsindependently manage their data. student submitted image, transcription available
How to solve in matlabs

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 Programming Questions!