We've come a long way. We know about variables (different loads like white and dark). We know about functions ( instructions on how to wash those loads). We've also learned about inputs to functions (fabric softener and bleach). We learned all the pieces of a program but we need to remember the main activity here is to wash a load of clothes.
Do you know how to wash clothes? We've done it so many times we do things we don't think need to be said. For example you might say the first thing to do is put the clothes in the washing machine, but you'd be wrong. We need to make sure the door is open to the washing machine and we should make sure it's empty. Instructions must assume nothing.
Some handy rules we want to follow when we are writing these instructions. Assume you will write the instructions on paper and give them to someone who has never washed clothes before. So our instructions will look like this.
A. Open the washing machine
B. Make sure the machine is empty
C. Decide which load to use
D. Set the controls for the load
E. Close the washing machine
F. Run the instructions for that load
G. Take the load out of the machine
We've used all the elements we've learned to date in the above instructions. When we look at the instructions above the Main washing machine instructions are the letters ( A,B,C,D,E and G). This would be what is called the main program.
If you have questions let me know. We have one more thing to learn and then we'll put it all together. You're closer than you think.
Sign up for the Chad Bishop Newsletter