You are on page 1of 24

Group No.

_6__

Group Members

1. ___________Hatud, Erika____________

2. _________Hermoso, Danica__________

3. ________Lising, Angela Nicole________

4. ________Loveres, Shania Faith______

5. _________Lumaban, Genesis_________

Date of Activity _____October 13, 2020______

Date of Submission _____October 15, 2020_____

Loveres, Shania Faith R Engr. Crispulo G. Maranan


Grading Criteria

Max Point Score Obtained

1 10

2 10

3 10

4 10

5 10

6 10

7 10

8 10

9 10

10 10

11 10

12 10

13 10

Total 130

Grade (TSO/TMP x 100)


Laboratory Exercise No. 3
SIMPLE SOLID MENSURATION MATLAB PROGRAM

1. Objective:
The activity aims to create matlab program that will ask the user to choose between the two types of figures
in solid mensuration and output the area, perimeter/circumference, volume or surface area of a certain figure.

2. Intended Learning Outcomes (ILOs):


The students shall be able to:
2.1 create matlab programs that will determine the area and perimeter of five(5) plane figures
2.2 create matlab programs that will determine the volume and surface area of five(5) solid figures
2.3 use switch…case… break in creating matlab program for a simple solid mensuration problem-solving
situation.

3. Discussion :
Solid Mensuration is a branch of mathematics that deals with the area and perimeter/circumference of plane
figures and volume and surface area of solid figures.

4. Resources:
Matlab

5. Procedure:
1. Using the matlab editor , choose File/New/ Blank m-file , type the following:
clc;
disp('Area of the Rectangle');
length=input('Enter the length of the rectangle: ');
width=input('Enter the width of the rectangle :');
area=length*width;
fprintf('The area of the rectangle is %0.2f. ',area );

2. Save the file as areaRectangle. Run the program and record the results.
3. Create m-file for the area of the square, right triangle, oblique triangle, circle and ellipse.
4. Create m-file for the perimeter of square, rectangle, right triangle, oblique triangle, circle and ellipse.
For circle, use circumference instead of perimeter.
5. Create m-file for the volume of cone, sphere, rectangular parallelepiped, right circular cylinder and
cube.
6. Create m-file for the surface area of cone, sphere, rectangular parallelepiped, right circular cylinder
and cube.
7. Using the matlab editor, choose File/New/Blank m-file, type the following:
clc;
disp('Area and Perimeter of the Rectangle');
choose=input('\n 1. Area of the Rectangle \n 2. Perimeter of the Rectangle \n Choose 1 or 2: ');
switch(choose)
case 1;
length=input('Enter the length of the rectangle: ');
width=input('Enter the width of the rectangle :');
area=length*width;
fprintf('The area of the rectangle is %0.2f. ',area );
break;
case 2;
length=input('Enter the length of the rectangle: ');
width=input('Enter the width of the rectangle :');
perimeter= 2*length + 2*width;
fprintf('The perimeter of the rectangle is %0.2f. ',perimeter );
break;
end
8. Create a matlab program that will ask the user to choose between plane figures and solid figures.
If the user will choose plane figures, he will then be ask to choose among the five (5) plane figures as
mentioned in Procedure No. 4. After choosing any of the five (5) plane figures, he will then be ask to choose
between area and perimeter. If the user will choose solid figures, he will then be ask to choose among the
five (5) solid figures as mentioned in Procedure No. 5. After choosing any of the five (5) solid figures, he will
then be ask to choose between volume and surface area. Necessary inputs are needed and the output will
be any of the area or perimeter of any of the five (5) plane figures and any of the volume and surface area of
any of the five (5) solid figures.
Course: CHE 508 Laboratory Exercise No.: 03
Group No.: 6 Section: CHE-51S1
Group Members: Date Performed: October 13, 2020
HATUD, Erika Date Submitted: October 15, 2020
HERMOSO, Danica Instructor: Engr. Crispulo G. Maranan
LISING, Angela Nicole
LOVERES, Shania Faith
LUMABAN, Genesis
6. Data and Results:

Procedure Results
2

3.1
3.2

3.3
3.4

3.5

4.1
4.2

4.3

4.4
4.5

4.6

5.1
5.2

5.3
5.4

5.5

6.1 Surface Area of the Cone

Enter the radius of the cone: 4

Enter the height of the cone: 3

The volume of the cone is 113.04. >>


clc;

disp('Surface Area of the Cone');

r=input('Enter the radius of the cone: ');

h=input('Enter the height of the cone: ');

sa=3.14*r*(r+(h^2+r^2)^(1/2));

fprintf('The surface area of the cone is %0.2f. ',sa );


6.2
Surface Area of the Sphere

Enter the radius of the sphere: 9

The surface area of the sphere is 1017.36. >>


clc;

disp('Surface Area of the Sphere');

r=input('Enter the radius of the sphere: ');

sa=4*3.14*r^2;

fprintf('The surface area of the sphere is %0.2f. ',sa


);

6.3
Surface Area of the Rectangular Parallelepiped

Enter the width of the rectangular parallelepiped: 8

Enter the length of the rectangular parallelepiped: 6

Enter the height of the rectangular parallelepiped: 7

The surface area of the rectangular parallelpiped is 292.00. >>


clc;

disp('Surface Area of the Rectangular Parallelepiped');

w=input('Enter the width of the rectangular


parallelepiped: ');

l=input('Enter the length of the rectangular


parallelepiped: ');

h=input('Enter the height of the rectangular


parallelepiped: ');

sa=2*(w*l+h*l+h*w);

fprintf('The surface area of the rectangular


parallelpiped is %0.2f. ',sa );
6.4
Surface Area of the Right Circular Cylinder

Enter the radius of the right circular cylinder: 8

Enter the height of the right circular cylinder: 1

The surface area of the right circular cylinder is 452.16. >>


clc;

disp('Surface Area of the Right Circular Cylinder');

r=input('Enter the radius of the right circular


cylinder: ');

h=input('Enter the height of the right circular


cylinder: ');

sa=(2*(3.14*r*h))+2*3.14*r^2;

fprintf('The surface area of the right circular


cylinder is %0.2f. ',sa );

6.5
Surface Area of the Cube

Enter the edge of the cube: 4

The surface area of the cube is 96.00. >>


clc;

disp('Surface Area of the Cube');

a=input('Enter the edge of the cube: ');

sa=6*a^2;

fprintf('The surface area of the cube is %0.2f. ',sa );


7
8 clc;

disp('Solid or Plane Figure');

choose=input('\n 1. Solid Figure \n 2. Plane Figure \n Choose 1 or 2: ');

switch (choose)

case 1

choose=input('\n 1. Cone \n 2. Sphere \n 3. Rectangular Parellelepiped \n 4. Right


Circular Cyinder \n 5. Cube \n Choose 1 to 5: ');

switch (choose)

case 1

choose=input('\n 1. Surface Area \n 2. Voume \n Choose 1 or 2: ');

switch(choose)

case 1

disp('Surface Area of the Cone');

r=input('Enter the radius of the cone: ');

h=input('Enter the height of the cone: ');

area=pi*r*(r+sqrt(h^2+r^2));

fprintf('The Surface Area of the cone is %0.2f. ', area);

case 2

disp('Volume of the Cone');

r=input('Enter the radius of the cone: ');

h=input('Enter the height of the cone: ');

vol=pi*r^2*(h/3);

fprintf('The Volume of the cone is %0.2f. ', vol);

end
case 2

choose=input('\n 1. Surface Area \n 2. Voume \n Choose 1 or 2: ');

switch(choose)

case 1

disp('Surface Area of the Sphere');

r=input ('Enter the Radius of the Sphere: ');

area=4*pi*r^2;

fprintf('The Surface Area of the Sphere is %0.2f. ', area);

case 2

disp('Volume of the Sphere');

r=input ('Enter the Radius of the Sphere: ');

vol=(4/3)*pi*r^3;

fprintf('The Volume of the Sphere is %0.2f. ', vol);

end

case 3

choose=input('n\ 1. Surface Area \n 2. Volume \n Choose 1 or 2:');

switch(choose)

case 1

disp('Surface Area of the Rectangular Parallelepiped');

l=input('Enter the length of the Rectangular Parallelepiped:');

w=input('Enter the width of the Rectangular Parallelepiped:');

h=input('Enter the height of the Rectangular Parallelepiped:');

a=2*((w*l)+(h*l)+(h*w));

fprintf('The surface area of the Rectangular Parallelepiped is %0.2f.',a);


case 2

disp('Volume of the Rectangular Parallelepiped');

l=input('Enter the length of the Rectangular Parallelepiped:');

w=input('Enter the width of the Rectangular Parallelepiped:');

h=input('Enter the height of the Rectangular Parallelepiped:');

a=l*w*h;

fprintf('The volume of the Rectangular Parallelepiped is %0.2f.',a);

end

case 4

choose=input('n\ 1. Surface Area \n 2. Volume \n Choose 1 or 2:');

switch(choose)

case 1

disp('Surface Area of the Cylinder');

r=input('Enter the radius of the cylinder: ');

h=input('Enter the height of the cylinder: ');

area=(2*pi*r*h)+(2*pi*r^2);

fprintf('The Surface Area of the cone is %0.2f. ', area);

case 2

disp('Volume of the Cylinder');

r=input('Enter the radius of the cylinder: ');


h=input('Enter the height of the cylinder: ');

area=(h*pi*r^2);

fprintf('The Volume of the Cyinder is %0.2f. ', area);

end

case 5

choose=input('n\ 1. Surface Area \n 2. Volume \n Choose 1 or 2:');

switch(choose)

case 1

disp('Surface Area of the Cube');

s=input ('Enter the Side of the Cube: ');

area=6*s^2;

fprintf('The Surface Area of the Cube is %0.2f. ', area);

case 2

disp('Volume of the Cube');

s=input ('Enter the Side of the Cube: ');

area=s^3;

fprintf('The Volume of the Cube is %0.2f. ', area)

end

end

case 2

choose=input('\n 1. Square \n 2. Rectangle \n 3. Right Triangle \n 4. Circle \n 5.


Ellipse \n Choose 1 to 5: ');
switch (choose)

case 1

choose=input('\n 1. Area \n 2. Perimeter \n Choose 1 or 2: ');

switch(choose)

case 1

disp('Area of the Square');

s=input('Enter the side of the square: ');

a=s^2;

fprintf('The Area f the Square is %0.2f. ', a);

case 2

disp('Perimeter of the Square');

s=input('Enter the side of the square: ');

p=4*s;

fprintf('The Perimeter of the Square is %0.2f. ', p);

end

case 2

choose=input('\n 1. Area \n 2. Perimeter \n Choose 1 or 2: ');

switch(choose)

case 1

disp('Area of the Rectangle');

l=input('Enter the Length of the Rectangle: ');

w=input('Enter the Width of the Rectangle: ');


a=l*w;

fprintf('The Area of the Rectangle is %0.2f. ', a);

case 2

disp('Perimeter of the Rectangle');

l=input('Enter the Length of the Rectangle: ');

w=input('Enter the Width of the Rectangle: ');

p=2*(l*w);

fprintf('The Perimeter of the Rectangle is %0.2f. ', p);

end

case 3

choose=input('\n 1. Area \n 2. Perimeter \n Choose 1 or 2: ');

switch(choose)

case 1

disp('Area of the Right Triangle');

b=input('Enter the base of the right triangle: ');

h=input('Enter the height of the right triangle: ');

a=(b*h)/2;

fprint('The Area of the Right Triangle is %0.2f. ', a);

case 2

disp('Perimeter of the Right Triangle');

b=input('Enter the base of the right triangle: ');

h=input('Enter the height of the right triangle: ');

p=h+b+sqrt(h^2+b^2);
fprint('The Perimeter of the Right Triangle is %0.2f. ', a);

end

case 4

choose=input('\n 1. Area \n 2. Circumference \n Choose 1 or 2: ');

switch(choose)

case 1

disp=('Area of the Circle');

r=input('Enter the Radius of the Circle: ');

a=pi*r^2;

fprintf('The Area of the Circle is %0.2f. ', a);

case 2

disp=('Circumference of the Circle');

r=input('Enter the Radius of the Circle: ');

c=2*pi*r;

fprintf('The Circumference of the Circle is %0.2f. ', c);

end

case 5

choose=input('\n 1. Area \n 2. Perimeter \n Choose 1 or 2: ');

switch(choose)

case 1

disp('Area of the Ellipse');

a=input('Enter the a axis of the ellipse: ');


b=input('Enter the b axis of the ellipse: ');

a=pi*a*b;

fprintf('The Area of the Ellipse is %0.2f. ', a);

case 2

disp('Perimeter of the Ellipse');

a=input('Enter the a axis of the ellipse: ');

b=input('Enter the b axis of the ellipse: ');

p=2*pi*sqrt((a^2+b^2)/2);

fprintf('The Area of the Ellipse is %0.2f. ', p);

end

end

end
7. Conclusion:

We therefore conclude that using matlab, we can create programs that will determine the area and perimeter
of a plane figure and a program that will determine the volume and surface area of a solid figure. All you need
to do is to input the needed values and matlab will provide you the output.

Also, using matlab, we were able to create a program that will ask its users to select different types of figures
in the field of solid mensuration; it also helps to determine the perimeter or circumference of an area.
8. Assessment (Rubric for Laboratory Performance):
TECHNOLOGICAL INSTITUTE OF THE PHILIPPINES
RUBRIC FOR MODERN TOOL USAGE
(Engineering Programs)
Student Outcome (e): Use the techniques, skills, and modern engineering tools necessary for engineering
practice in complex engineering activities.
Program: Chemical Engineering Course: CHE508 Section: CHE51S1 1stSem SY 2020-2021
Performance Unsatisfactory Developing Satisfactory Very Satisfactory Score
Indicators 1 2 3 4
1. Apply Fails to identify Identifies Identifies modern Recognizes the
appropriate any modern modern techniques and is benefits and
techniques, techniques to techniques but able to apply constraints of
skills, and perform fails to apply these in modern
modern tools to discipline- these in performing engineering tools
perform a specific performing discipline-specific and shows
discipline- engineering discipline- engineering task. intention to apply
specific task. specific them for
engineering engineering engineering
task. task. practice.
2. Demons Fails to apply Attempts to Shows ability to Shows ability to
trate skills in any modern apply modern apply fundamental apply the most
applying tools to solve tools but has procedures in appropriate and
different engineering difficulties to using modern effective modern
techniques and problems. solve tools when solving tools to solve
modern tools to engineering engineering engineering
solve problems. problems. problems.
engineering
problems.
3. Recogni Does not Recognizes Recognizes the Recognizes the
ze the benefits recognize the some benefits benefits and need for benefits
and constraints benefits and and constraints of and constraints of
of modern constraints of constraints of modern modern
engineering modern modern engineering tools engineering tools
tools. engineering engineering and shows and makes good
tools. tools. intention to apply use of them for
them for engineering
engineering practice.
practice.
Total Score
Mean Score = (Total Score / 3)
Percentage Rating = (Total Score / 12) x 100%
Evaluated by: Engr. Crispulo G. Maranan October 15, 2020
Printed Name and Signature of Faculty Member Date

You might also like