The Attempt at a Solution
Alright, so we just began messing with functions in our class and I'm kinda struggling to grasp this assignment. I believe it should begin like this:
shape = menu('Choose a shape','1: Sphere','2: Isosceles Triangular Pyramid','3: cylinder','4: Cone','5: Rectangular Prisim','-1: Exit');
r=input('Enter the radius of the sphere (Inches): ');
sphereArea = surfaceAreaShapes(r);
sphereVolume = volumeShapes(r)
%calling the functions^^^^
%note: Im only showing 1 case of the switch statement and I realize the while loop is . %missing an end.
now that I called the functions, now I have to make em...(surfaceAreaShapes.m and volumeShapes.m) This is where I get super confused. I have a general idea that I'll perform an if/switch statement in order to call up the right formula that corresponds with the shape the user inputs. Just not real sure on the correct formatting of a function.
...Heres what I got for surfaceAreaShapes.m
the parameter radius I set doesn't seem like it would make sense considering I will have other things that will need to be put in in order to determine area.
*sorry in advance its not indented properly. That bugs the hell outta me
58.6 KB Views: 410