Sunday, July 15, 2012

Algorithms

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?

a. Sequence and selection
b. The two properties above.

2. Define Algorithms for the following processes.

Posting a letter
1. Write letter
2. Put in envelope
3. Seal the envelope
4. Write the address and postcode on the envelope
5. Drop envelope in the postbox.

Making toast
1. Spread butter on bread
2. Put bread in the toaster
3. Wait until toast comes out

Calling a friend on the phone
1. Dial the number of friend
2. Press call button
3. Wait until friend answersf

No comments:

Post a Comment