Question: MATHLAB uSING MATHLAB 2. In order to have a closed geometric figure composed of straight lines the angles in the figure must add to (n

MATHLAB

MATHLAB uSING MATHLAB 2. In order to have a closed geometric figure

uSING MATHLAB

2. In order to have a closed geometric figure composed of straight lines the angles in the figure must add to (n 2) (180 degrees) where n is the number of sides. a) 12 pts] Prove this statement by creating a vector called n from 3 to 6 and calculating the angle sum from the formula. b) [4 pts] Write a program that prompts the user to enter one of the following: triangle square pentagon hexagon Define the value of n for the above four cases via a switch/case structure; then use n to calculate the sum of the interior angles in the figure. Send an error message if the user enters something other than above polvgons. c) 14 pts] Reformulate your program from part (b) so that it uses a menu For parts (b) and (c) display the answer in following format For example, if user enters 'pentagon' the output should look like Sum of the angles of a pentagon is 540

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!