Thursday, September 20, 2012

What is an Algorithm

1.   boil the water,
2.   place coffee in the cup,
3.   place sugar in the cup,
4.   add the boiling water,
5.   add milk,
6.   stir.

1.           Examine the algorithm above. What two properties of the algorithm enable it to correctly describe the solution to the problem of making a cup of coffee? What is it that makes an algorithm correct?(Hint: what would happen if you swapped step "6" and step "2"?)

2.correct sequence 

Swapping steps would change th end product and this case it wouldn't work at all.

Define Algorithms for the following processes.

Posting a letter.
1.Write Letter
2. Place letter in envelope
3. Write adress of desired place on the front of the envelope.
4. Seal Envelope
5. Stick Stamp on in top right corner
6. Place in post box.

Making toast.
1.Place bread in toaster
2.Push down lever to start toasting
3.Wait 2-3 minutes or until toast pops up
4.Place desired topping on toast
Calling a friend on the phone
1. Select friend to call
2.Press green call button
3.Wait for answer
4. If phone rings out try steps 1-3 again until friend answers
5.Talk to friend

No comments:

Post a Comment