Subing a sub
Breaking a sub into more subs.
Breaking a sub into more subs.
Understand subs, by taking an existing program, and break it into pieces
Compute the total price for an order of pinatas.
(If you were logged in as a student, you could submit an exercise solution, and get some feedback.)
How many dwarves do you need to match a number of Snow Whites?
(If you were logged in as a student, you could submit an exercise solution, and get some feedback.)
Find the roots of a quadratic again, but the Subs.
(If you were logged in as a student, you could submit an exercise solution, and get some feedback.)
h1.
DRY stands for Don't Repeat Yourself. One of the Big Ideas of programming.
So far, each of the subs has been called just once per program. Let's do something different.
Remember that strange tax return program? The worksheet:
Let's add input validation.