Vous êtes sur la page 1sur 10

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 switchcase break in creating matlab program for a simple solid mensuration problemsolving 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');
% Input here
length=input('Enter the length of the rectangle: ');
width=input('Enter the width of the rectangle :');
% Process here
area=length*width;
% Output here
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
Save the file as areaPeriRect.m and run.
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:
Group No.:
Group Members:
Date Submitted: Instructor:

Laboratory Exercise No.:


Section:
Date Performed:

6. Data and Results:


Procedure

Results
2

clc;
disp('Area of the Square');
%Input here...
length=input('Enter the length of the Square:');
width=input('Enter the width of the Square:');
%Process here...
area=length*width;
%Output here...
fprintf('The area of the square is %0.2f.',area );
clc;
disp('Area of the Right Triangle');
%Input here...
base=input('Enter the base of the Right
Triangle:');
height=input('Enter the height of the Right
Triangle:');
%Process here...
area=(1/2)*base*height;
%Output here...
fprintf('The area of the square is %0.2f.',area );
clc;
disp('Area of the Oblique Triangle');
%Input here...
a=input('Enter the side a of the Oblique
Triangle:');
b=input('Enter the side b of the Oblique
Triangle:');
c=input('Enter the side c of the Oblique
Triangle:');
%Process here...
s = (a+b+c)/2
area=sqrt(s*(s-a)*(s-b)*(s-c));
%Output here...
fprintf('The area of the square is %0.2f.',area );
clc;
disp('Area of the Circle');
%Input here...
radius=input('Enter the radius of the Circle:');
%Process here...
area=pi*radius^2;
%Output here...
fprintf('The area of the Circle is %0.2f.',area );

Area of the Square


Enter the length of the Square: 05
Enter the width of the Square: 05
The area of the square is 25.00.>>

Area of the Right Triangle


Enter the base of the Right Triangle: 03
Enter the height of the Right Triangle: 04
The area of the Right Triangle is 6.00.>>

Area of the Oblique Triangle


Enter the side a of the Oblique Triangle: 03
Enter the side b of the Oblique Triangle: 04
Enter the side c of the Oblique Triangle: 05
s=
6
The area of the Oblique Triangle is 6.00.>>
Area of the Circle
Enter the radius of the Circle: 08
The area of the Circle is 201.06.>>

clc;
disp('Area of the Ellipse');
%Input here...
a=input('Enter the major of the Ellipse:');
b=input('Enter the minor of the Ellipse:');
%Process here...
area=pi*a*b;
%Output here...
fprintf('The area of the Ellipse is %0.2f.',area );

clc;
disp('Perimeter of the Square');
%Input here...
s=input('Enter the side of the Square:');
%Process here...
perimeter=4*s;
%Output here...
fprintf('The perimeter of the Square is
%0.2f.',perimeter );
clc;
disp('Perimeter of the Right Triangle');
%Input here...
a=input('Enter the side a of the Right Triangle:');
b=input('Enter the side b of the Right Triangle:');
%Process here...
perimeter= a + b + (sqrt(a^2 + b^2));
%Output here...
fprintf('The perimeter of the Right Triangle is
%0.2f.',perimeter );
clc;
disp('Perimeter of the Oblique Triangle');
%Input here...
a=input('Enter the side a of the Oblique
Triangle:');
b=input('Enter the side b of the Oblique
Triangle:');
c=input('Enter the side c of the Oblique
Triangle:');
%Process here...
perimeter= a + b + c;
%Output here...
fprintf('The perimeter of the Oblique Triangle is
%0.2f.',perimeter );
clc;
disp('Circumference of the Circle');
%Input here...
r=input('Enter the radius of the Circle:');
%Process here...
circumference= 2*pi*r;
%Output here...
fprintf('The circumference of the Circle is
%0.2f.',circumference );

Area of the Ellipse


Enter the major of the Ellipse: 05
Enter the minor of the Ellipse: 04
The area of the Ellipse is 62.83.>>

Perimeter of the Square


Enter the side of the Square: 06
The perimeter of the Square is 24.00.>>

Perimeter of the Right Triangle


Enter the side a of the Right Triangle: 06
Enter the side b of the Right Triangle: 06
The perimeter of the Right Triangle is 20.49.>>

Perimeter of the Oblique Triangle


Enter the side a of the Oblique Triangle: 06
Enter the side b of the Oblique Triangle: 07
Enter the side c of the Oblique Triangle: 05
The perimeter of the Oblique Triangle is 18.00.>>

Circumference of the Circle


Enter the radius of the Circle: 56
The circumference of the Circle is 351.86.>>

clc;
disp('Perimeter of the Ellipse');
%Input here...
a=input('Enter the major of the Ellipse:');
b=input('Enter the minor of the Ellipse:');
%Process here...
perimeter= 2*pi*(sqrt((a^2 + b^2)/2));
%Output here...
fprintf('The perimeter of the Ellipse is
%0.2f.',perimeter );

5
clc;
disp('Volume of the Cone');
%Input here...
r=input('Enter the radius of the Ellipse:');
h=input('Enter the height of the Ellipse:');
%Process here...
volume= (1/3)*pi*r^2*h;
%Output here...

fprintf('The volume of the Cone is


%0.2f.',volume );

clc;
disp('Volume of the Sphere');
%Input here...
r=input('Enter the radius of the Sphere:');
%Process here...
volume=(4/3)*pi*r^3 ;
%Output here...
fprintf('The volume of the Sphere is
%0.2f.',volume );

Perimeter of the Ellipse


Enter the major of the Ellipse: 05
Enter the minor of the Ellipse: 03
The perimeter of the Ellipse is 25.91.>>

Volume of the Cone


Enter the radius of the Ellipse: 06
Enter the height of the Ellipse: 08
The volume of the Cone is 301.59.>>

Volume of the Sphere


Enter the radius of the Sphere: 98
The volume of the Sphere is 3942455.83.>>

Volume of Rectangular Parallelepiped


clc;
Enter the length of Rectangular Parallelepiped : 07
disp('Volume of Rectangular
Enter the width of Rectangular Parallelepiped : 08
Parallelepiped');
Enter the height of Rectangular Parallelepiped :
%Input here...
l=input('Enter the length of Rectangular 10
The Volume of Rectangular Parallelepiped is
Parallelepiped :');
w=input('Enter the width of Rectangular 560.00.>>
Parallelepiped :');
h=input('Enter the height of Rectangular
Parallelepiped :');
%Process here...
volume= l*w*h;
clc;
Volume of the Right circular cylinder
disp('Volume of the Right circular cylinder');
Enter the radius of the Right circular cylinder: 56
%Input here...
Enter the height of the Right circular cylinder: 79
r=input('Enter the radius of the Right circular
The volume of the Right circular cylinder is
cylinder:');
778310.73.>>
h=input('Enter the height of the Right circular
cylinder:');
%Process here...
volume=pi*r^2*h ;
%Output here...
fprintf('The volume of the Right circular cylinder is
%0.2f.',volume );

clc;
disp('Volume of the Cube');
%Input here...
s=input('Enter the sides of the cube:');
%Process here...
volume=s^3 ;
%Output here...
fprintf('The volume of the Cube is
%0.2f.',volume );

Volume of the Cube


Enter the sides of the cube: 09
The volume of the Cube is 729.00.>>

6
Surface Area of Cone
Enter the radius of the Cone: 56
clc;
Enter the height of Cone: 78
disp('Surface Area of Cone');
The Surface Area of Cone is 1631919.15.>>
%Input here...
r=input('Enter the radius of the Cone:');
h=input('Enter the height of Cone:');
%Process here...
SA = pi*r*(r+h^2+r^2);
%Output here...
Surface Area of Sphere
clc;
Enter the radius of the Sphere: 45
disp('Surface Area of Sphere');
The Surface Area of Sphere is 25446.90.>>
%Input here...
r=input('Enter the radius of the Sphere:');
%Process here...
SA = 4*pi*r^2;
%Output here...
fprintf('The Surface Area of Sphere is
Surface Area of Rectangular Parallelepiped
clc;
Enter the of length Rectangular Parallelepiped: 24
disp('Surface Area of Rectangular
Enter the of width Rectangular Parallelepiped: 26
Parallelepiped');
Enter the of height Rectangular Parallelepiped: 35
%Input here...
l=input('Enter the of length Rectangular The Surface Area of Rectangular Parallelepiped is
4748.00.>>
Parallelepiped:');
w=input('Enter the of width Rectangular
Parallelepiped:');%Process here...
h=input('Enter the of height Rectangular
Parallelepiped:');
SA = 2*((w*l)+(h*l)+(h*w));
%Output here...
Surface Area of Right Circular Cylinder
clc;
Enter the of radius of Right Circular Cylinder: 23
disp('Surface Area of Right Circular
Enter the height of Right Circular Cylinder: 56
Cylinder');
The Surface Area of Right Circular Cylinder is
%Input here...
11416.55.>>
r=input('Enter the of radius of Right
Circular Cylinder:');
h=input('Enter the height of Right Circular
Cylinder:');
%Process here...
SA = (2*pi*r*h)+(2*pi*r^2);
%Output here...

clc;
disp('Surface Area of Cube');
%Input here...
a=input('Enter the of sides of Cube:');
%Process here...
SA = 6*a^2;
%Output here...

Surface Area of Cube


Enter the of sides of Cube: 25
The Surface Area of Cube is 3750.00.>>

7. Conclusion:

8. Assessment (Rubric for Laboratory Performance):


T I P V P A A 0 5 4 D

TECHNOLOGICAL INSTITUTE OF THE PHILIPPINES

Revision Status/Date: 0/2009 September 09

RUBRIC FOR LABORATORY PERFORMANCE

CRITERIA

BEGINNER

ACCEPTABLE

PROFICIENT

Members do not demonstrate


needed skills.

Members
occasionally
demonstrate needed skills.

Members always demonstrate


needed skills.

Experimental Set-up

Members are unable to set-up


the materials.

Members are able to set-up


the materials with supervision.

Members are able to set-up


the material with minimum
supervision.

Process Skills

Member do not demonstrate


targeted process skills.

Members
occasionally
demonstrate targeted process
skills.

Members always demonstrate


targeted process skills.

I. Laboratory Skills
Manipulative
Skills

SCORE

Members do not follow safety


precautions.

Members
follow
safety
precautions most of the time.

Members
follow
safety
precautions at all times.

Time Management /
Members do not finish on time
Conduct
of
with incomplete data.
Experiment

Members finish on time with


incomplete data.

Members finish ahead of time


with complete data and time to
revise data.

Members do not know their


tasks and have no defined
responsibilities. Group conflicts
have to be settled by the
teacher.

Members
have
defined
responsibilities most of the
time.
Group conflicts are
cooperatively managed most
of the time.

Members are on tasks and


have defined responsibilities at
all times. Group conflicts are
cooperatively managed at all
times.

Safety Precautions
II. Work Habits

Cooperative
Teamwork

and

Neatness
Orderliness

and

Messy workplace during and


after the experiment.

Clean and orderly workplace Clean and orderly workplace at


with occasional mess during all times during and after the
and after the experiment.
experiment.

Ability
to
do
independent work

Members require supervision


by the teacher.

Members require occasional


supervision by the teacher.

Members do not need to be


supervised by the teacher.

TOTAL SCORE
Other Comments / Observations:

TotalScore

RATING = (

24

Evaluated by:

Printed Name and Signature of Faculty Member

Date:

) x 100%

Vous aimerez peut-être aussi