Warm-up+Activity+-+Think+Like+a+Computer


 * Thinking like a computer (or a robot)**


 * Author:** Daniel Sinkovitz, 2011

The purpose of this exercise is to get you thinking about how you would need to tell a computer to do something for you, which is basically what computer programming is. //Computers are very precise. They only do exactly what you tell them.// This is great because they are predictable and will act exactly the way they have been programmed to. It can also be a challenge because computers don't have any "common sense", so that serious problems can result if the instructions they are given do not carefully address every situation that may occur. > (Feel free to copy some of the instructions wholesale if you like them; it's good programming practice to reuse code.) > (These are fine examples, no need to think of another, and if you do, keep it simple! See how many steps just to make a ham and cheddar sandwich!) > (For example, "If cannot find bread, report, 'I cannot make a ham and cheddar sandwich because there is no bread.' End." But make sure everything gets put back to its place even if you have to abort in the middle!)
 * Your task is to write specific instructions to tell a robot how to prepare a common food item.
 * Be as specific as you can. See the example on the reverse side that I wrote for making a ham and cheddar sandwich.
 * Try something simple, like a peanut butter and jelly sandwich or a hot dog.
 * For now, assume that all of the ingredients are available and have not run out. For extra credit, consider how you would amend your program so that it would respond appropriately if some ingredients were missing.