You are on page 1of 6

Charlotte Manipol Pestaño

BSCE

Pseudocode and Flowchart


Input Process Output
s PerimeterS= 4*s Perimeter of a Square
AreaS= s*s Area of a Square
b1,b2,l1,l2 PerimeterT= b1+b2+l1+l2 Perimeter of a Trapezoid
b1,b2,H AreaT= b1+b2*H/2 Area of a Trapezoid
a,b PerimeterP= a*2+b*2 Perimeter of a Parallelogram
b,H AreaP= b*H Area of a Parallelogram
s VolumeC= s*s*s Volume of a Cube
s SurfaceC= 6*s*s Surface Area of a Cube
b,H VolumeRP= b*b*H/3 Volume of a Square or
Rectangle Pyramid
b,s SurfaceRP= 2*b*s+b*b Surface Area of a Square or
Rectangle Pyramid
l,w,H VolumePrism= l*w*H Volume of a Rectangular
Prism (Box)
l,w,H SurfacePrism= Surface Area of a
2*(w*H+w*l+l*H) Rectangular Prism (Box)

Step1: Start
Step 2:Enter Your Choice From Options(1-12)
Step3 : Determine the Mathematical Formula to be performed.

switch(choice){
case 1:{
Enter the Side of a Square
Display and Label the Figure of a Square
PerimeterS= 4*s
Display the Perimeter of a Square
}
break;
case 2:{
Enter the Side of a Square
Display and Label the Figure of a Square
AreaS= s*s
Display the Area of a Square
}
Break;

case 3:{
Enter the Base 1 of a Trapezoid
Enter the Base 2 of a Trapezoid
Enter the Leg 1 of a Trapezoid
Enter the Leg 2 of a Trapezoid
Display and Label the Figure of a Trapezoid
PerimeterT= b1+b2+l1+l2
Display the Perimeter of a Trapezoid
}
break;
case 4:{
Enter the Base 1 of a Trapezoid
Enter the Base 2 of a Trapezoid
Enter the Height of a Trapezoid
Display and Label the Figure of a Trapezoid
AreaT= b1+b2*H/2
Display the Area of a Trapezoid
}
break;
case 5:{
Enter the Side of a Parallelogram
Enter the Base of a Parallelogram
Display and Label the Figure of a Parallelogram
PerimeterP= a*2+b*2
Display the Perimeter of a Parallelogram
}
break;

case 6:{
Enter Base of a Parallelogram
Enter the Height of a Parallelogram
Display and Label the Figure of a Parallelogram
AreaP= b*H
Display the Area of a Parallelogram
}
break;

case 7:{
Enter the Side of a Cube
Display and Label the Figure of a Cube
VolumeC= s*s*s
Display the Volume of a Cube
}
break;
case 8:{
Enter the Side of a Cube
Display and Label the Figure of a Cube
SurfaceC= 6*s*s
Display the Surface Area of a Cube
}
break

case 9:{
Enter the Base of a Square or Triangular Pyramid
Enter the Height of a Square or Triangular Pyramid
Display and Label the Figure of a Square or Triangular Pyramid
VolumeRP= b*b*H/3
Display the Volume of a Square or Triangular Prism
}
break;

case 10;{
Enter the Side of a Square or Rectangular Pyramid
Enter the Base of a Square or Rectangular Pyramid
Display and Label the Figure of a Square or Rectangular Pyramid
SurfaceRP= 2*b*s+b*b
Display the Volume of Square or Rectangular Pyramid
}

break;

case 11:{
Enter the Width of a Rectangular Prism
Enter the Length of a Rectangular Prism
Enter the Height of a Rectangular Prism
Display and Label the Figure of a Rectangular Prism
VolumePrism= l*w*h
Display the Volume of a Rectangular Prism
}
break;

case 12:{
Enter the Width of a Rectangular Prism
Enter the Length of a Rectangular Prism
Enter the Height of a Rectangular Prism
Display and Label the Figure of a Rectangular Prism
SurfacePrism= 2*(w*H+w*l+l*H)
}
break:

default:
Display “Unknown”
}

Step 4: Make an Option to Try Again [Y/N]


if(ans=='Y' || ans=='y')
goto Step 2;
else if (ans=='N' || ans=='n')
goto Step 5;
else
Display “Invalid Response”
goto Step 4;
Step 5: End
Start

Enter Your
Choice From
Options (1-12)

Yes Display the


case PerimeterS= 4*s Figure, label
1 Enter the Side x
and
of a Square
,Perimeter of
a Square
No

Display the
Yes Figure, label
case AreaS=s*s x
Enter the Side and ,Area of
2 x

of a Square a Square

No

Display the
Yes Enter the PerimeterT=b1 Figure, label
case base 1, base x
+b2+l1+l2 and,
3 2, leg 1, and Perimeter of
leg 2 of a a Trapezoid
Trapezoid
No

Yes AreaT=b1+b2* Display the


case Enter the
H/2 Figure, label x
4 base 1, base
and, Area of
2, and height
a Trapezoid
of a Trapezoid

No

Display the
Yes PerimeterP=a*2
case Figure, label
Enter the side +b*2 x
5 and ,Perimeter
and base of a
of a
Parallelogram
Parallelogram

No

Display the
case Yes Enter the AreaP=b*H Figure, label x
6 base and and ,Area of a
height of a Parallelogram
Parallelogram
No

Display the
Yes Figure, label
case VolumeC=s*s*s
Enter the Side
and , x
7 Volume of a
of a Cube
Cube

No

Display the
case Yes SurfaceC=
Figure, label x
8 Enter the side 6*s*s
and ,Surface
of a Cube
Area of a
Cube
No

2
1

Enter the Display the


Yes VolumeRP=b*b Figure, label
base and
case *H/3 and ,Volume x
height of a
9 Square or of a Square
Rectangle or Rectangle
Pyramid Pyramid
No

Display the
case Yes Enter the SurfaceRP=2*b Figure, label
*s+b*b and ,Surface
x
10 base and side
of a Square or Area of a
Rectangle Square or
Pyramid Rectangle
No Pyramid

Display the
case Yes VolumePrism=L Figure, label
Enter the
11 width,length,a *w*H and , x
nd height of a Volume of a
Rectangular Rectangular
Prism Prism
No

Display the
Enter the SurfacePrism= Figure, label
case Yes and , x
width,length,a 2*(w*H+w*l+l*H
12 nd height of a Surface
)
Rectangular Area of a
Prism Rectangular
Prism
No

default Yes x
Display
“Unknown"

No

Try Yes
Again? y

No

End

You might also like