Question: User - Defined Classes and Object - OrientedProgrammingTask 1 : Define the Rectangle ClassCreate a new file named Rectangle.m . Define a class Rectangle with
UserDefined Classes and ObjectOrientedProgrammingTask : Define the Rectangle ClassCreate a new file named Rectangle.mDefine 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 : 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 : Test the Rectangle ClassInstantiate a Rectangle object named rect with specific width and length values.Test the area and perimeter methods by calling them on the rect object.Display the results to verify correctness.Task : 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
