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?(Hint: what would happen if you swapped step "6" and step "2"?)
If step two and step six were swapped it wouldn’t really make sense because then you will be stirring an empty cup
2. Define Algorithms for the following processes.
Posting a letter.
1. Write the letter
2. Place the letter in an envelope
3. Put the envelope in the post box
Making toast.
1. Get the bread out
2. Set up the toaster
3. Put the toast in the toaster
Calling a friend on the phone
1. Get the phone
2. Find your friends number
3. Dial that number and call
No comments:
Post a Comment