Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started