please provide code, result and chartflow
- BCEE 231 Homework Set #2 Due date: Monday March 8, 2021 Check the course outline for the procedure of submission. Note: The units should be in sl. Make the use of both user-defined and built-in MATLAB functions as well as the conditional statements in your program P1 (20%). Figure 1 shows the geometry formulas for common 2D shapes. Write a MATLAB program that ask the user about the shape, as well as corresponding parameters and calculate the area. SQUARE CIRCLE AA PP Dritter der Are Circ C RECTANGLE 1th with AA Pere P21+ SECTOR OF CIRCLE ogle in de A. Arc Lytle = or TRIANGLE be ATA Perinden A ELLIPSE imajas w AA Chce C=X+1 -46 +507) EQUILATERAL TRIANGLE Hilda 4. A4 ANNULUS notis Rwer A. Rahoir+R) With A R) PARALLELOGRAM lig, 22 REGULAR POLYGON TRAPEZOID ww ed Am (t) Pube Awo 1-) 1 P2 (20%). Extend the program you wrote in P1 in a way that calculate the perimeter or circumference of each shape as well. P3 (30%). Fosquare, circle, rectangular, triangle, sector of circle and regular polygon with n number of sides (where n= 5+last digit of your student ID number), write a program that ask the user for the shape and plot each shape given the parameters provided. The program should plot the geometry in the first quadrant. P4 (30%). For circle, square and annulus write a program to find the area, perimeter (or circumference) for a range of parametric values given by the user and plot the corresponding shapes in the range given. User needs to identify lower and upper values of each parameter. The identified range for the parameters should be then divided into 8 monotonic steps inside your program. Accordingly, you need to calculate the values and plot the shapes corresponding to all 8 values in the range identified by the user. The program should plot the geometries in the first quadrant