Sunday, July 15, 2012

Algorithms


What is an Algorithm?
An unambiguous set of steps, which when performed correctly by a processor, will result in a process being carried out in a finite time.

What two properties of the algorithm enable it to correctly describe the solution to the problem of making a cup of coffee?
The two properties of the algorithm is that it is specific and it is in the correct sequence.

Define Algorithms for the following processes.


Posting a letter.
1. Get a pen and piece of paper.
2. Write the letter.
3. Put the letter in the envelope.
4. Write the posting address on the envelope.
5. Write on the back side of the envelope, who the letter is from and the return address.
6. Put a stamp on the envelope.
7. Post the letter at your local post office. 

Making toast.
1. Turn on the toaster.
2. Get a slice of bread.
3. Place the slice of bread in the toaster.
4. Push the lever down on the toaster.
5. Wait for 2-3 mintues, until the bread slice pops out.
6. Spread desired amount of jam or butter on the toasted slice of bread.

Calling a friend on the phone.
1. Pick up the phone.
2. Dial the number on the phone.
3. Press the talk button.
4.Wait for the person to pick up if person doesnt pick up,call again.
5. Have fun chatting with your friend!

No comments:

Post a Comment