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.
Objectives[edit | edit source]
- Understand the level of detail required when planning and writing computer programs.
Prerequisites[edit | edit source]
Introduction[edit | edit source]
Questions[edit | edit source]
- 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?
Possible Solution[edit | edit source]
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
Activity[edit | edit source]
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?
Applications[edit | edit source]
- 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?