Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

5. Understand how cultural values influence conflict behavior.

Answered: 1 week ago