Question: Want the answers in MatLab codes script 1.The area A of a rhombus is defined as A-d1d2/2 and the perimeter P of rhombus is 2
Want the answers in MatLab codes script
1.The area A of a rhombus is defined as A-d1d2/2 and the perimeter P of rhombus is 2 defined as P-4.11 +1-2 | , where d!and d2 are the lengths ofthe two diagonals in inches a. Write a function rhombus that accepts dl and d2 as inputs and return the area and the perimeter of the rhombus. Write a script that first prompts the user for the lengths of the two diagonals. If either is a negative number of zero, the prints an error message. Otherwise, if they are both positive, it calls a function rhombus ( in a) to return the area and the perimeter of the rhombus, and then print the result with 1 decimal places. b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
