You are on page 1of 2

CS10-8L: Computer Programming Laboratory

Exercise #1: Getting Started

Name: RECTO, LESTHER SAIRY A. Score:

Section: B23 Date:


December
06, 2020

ANSWERS
1.
a. Answer: -106
Command:
2-4*(5^(3-2)+2*(5+6))

ans =

-106

b. Answer: 1.0909
Command:

2-((4*5^(3-2))/(2*(5+6)))

ans =

1.0909

c. Answer: -1.1250
Command:

2-((4*5^(3-2))/((2/5)+6))

ans =

-1.1250

2. Answer: 163.3333
Command:
% The volume of a truncated pyramid with a = 5, b = 3 and h = 10
a=5

a =

Prepared by: Engr. Cheryl Mari M. Isip


CS10-8L: Computer Programming Laboratory
Exercise #1: Getting Started

b=3

b =

h=10

h =

10

% formula of the truncated pyramid V=1/3(a^2+ab+b^2)h


V=1/3*(a^2+a*b+b^2)*h

V =

163.3333

Prepared by: Engr. Cheryl Mari M. Isip

You might also like