Question: Write a MATLAB script that calculates the area, perimeter, and diagonal of a square, rectangle or a parallelogram. The user should indicate which shape they

 Write a MATLAB script that calculates the area, perimeter, and diagonal

Write a MATLAB script that calculates the area, perimeter, and diagonal of a square, rectangle or a parallelogram. The user should indicate which shape they would like to know the area, diagonal and perimeter of. They should then be able to enter the dimensions for the shape [length of all 4 sides]. The calculations should be performed using this data entered by the user. Guidelines: 1. The user indicates the desired shape by entering 1,2 or 3.1 corresponds to rectangle, 2 to square and 3 to parallelogram. 2. To calculate the diagonal for the parallelogram the user will need to enter the interior angles, so F the user chooses option 3 , then ask for the interior angles to be entered. 3. WHILE the user does not enter 1,2 OR 3 then the program, should continuously ask them to re-enter until a valid option is chosen 4. After calculations, display the results back to the user in an appropriate format. [10 marks]

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!