You are on page 1of 3

UNIDAD EDUCATIVA PARTICULAR BILINGÜE MARTIM CERERÊ

AÑO LECTIVO 2018 – 2019

ASIGNATURA:COMPUTER SCIENCE ACTIVIDAD:HOMEWORK


NOMBRE:ESTEBAN VASQUEZ FECHA:01/10/18
CURSO: TERCERO A
TEMA:ALGORITHMS CALIFICACIÓN:

1st Problem: ATM

Write and algorithm to obtain $20 from any ATM (Automatic Teller Machine).

Start

Put a debit card Log in error

Enter password

Is
YES password NO
correct?

Select the
amount 20$

Take the receipt and


money

End
2nd Problem: Omelet

Write and algorithm to make and omelet

Start

Get :2 eggs ,2 Tbsp. water


,1/8 tsp. salt ,Dash pepper
,1 tsp. butter , ½ cup of
vegetabes

Add the eggs , sa,t


and pepper in a
bowl and mix them

Heat the pan with


butter

Pour the mixture


into the pan gently

Serve it
Cook it

Add vegetables and


blend it

Is the
NO mixture
YES
thickened
?

2nd Problem: How can you measure 4 liters?


Suppose you are at the side of a river (that means you have unlimited amount of water) and
you have 2 empty jugs; one of 3 liters and one of 5 liters. The jugs don’t have markings to
allow measuring smaller quantities. Give an efficient algorithm to obtain exactly 4 liter of water
in one of the jugs. You can throw all the water from any jug any point of time.

5liters
3liters
Start

Get both jugs

Pour water until the


half of both jugs 5
liters(2,5 l) and 3 liters
(1,5 l)

NO
Is the jug
filled until Yes
the half?

Fill both into the 5


liter
jugs(2,5+1,5=4l)

End

You might also like