Programming Fundamentals/Introduction/Minding the Details
One of the biggest challenges students face in learning programming is overlooking important details that are necessary for successful completion of a given program. This activity introduces the step-by-step nature of computer programming by having you plan out instructions you will ask your partner to follow to accomplish a specific task. This activity will help you understand and appreciate the level of detail required when writing computer programs.
- Understand the level of detail required when planning and writing computer programs.
- How many steps do you think are necessary to make a peanut butter and jelly sandwich?
- How many steps are necessary if you have to explain it to someone who has never made a peanut butter and jelly sandwich before?
How to make a peanut butter and jelly sandwich:
- Get out bread, peanut butter, and jelly
- Open bread bag
- Take out two slices of bread
- Close bread bag
- Open peanut butter jar
- Open jelly jar
- Get knife from drawer
- Use knife to spread 2 tablespoons of peanut butter on one slice of bread
- Use knife to spread 1 tablespoon of jelly on the other slice of bread
- Put both slices of bread together with peanut butter facing jelly
- Cut sandwich in half, if desired
- Put knife in sink or dishwasher
- Close jelly jar
- Close peanut butter jar
- Put bread, peanut butter, and jelly away
With a partner, consider the following scenario: Assume you are sitting in a classroom. You are directing your partner to write your name on the board in the front of the classroom and then return to their seat.
- What steps are necessary to make this happen? Write down the steps.
- Compare your list of instructions with your partner's list. Discuss any differences and make adjustments, if necessary.
- Take turns following the directions and asking your partner to follow the steps as you read them out.
- If you are the partner following instructions, you can't make any assumptions. If an important detail is missing, stop and return to your seat and ask your partner to make corrections. Then try again.
- How many steps are necessary in order for your partner to correctly write your name on the board?
- Compare and contrast providing detailed instructions to a partner with computer programming (providing detailed instructions to a computer).
- Identify specific steps you will want to take when planning and writing computer programs.
- Discuss your activity experience with your classmates. What surprised you? What have you learned that you can apply to your own school or work environment?