Here's the header. Subfest equal the peremiter.
For example, let's go grab a cash register.
And then modify it so that all the values for loonies, toonies, fives, tens and
ones are different. Now we'll call this special method.
Now we need to decide what we want this output to look like.
We'll say the cash register has $160 in it.
We did a quick calculation off screen... And let's put in parenthesis how many
loonies there are, how many two toonies there are, and so on.
For the type contract, self refers to a cash register object, and this method
returns a string. In fact it returns a string
representation of this cash register. For the method body, well return the
string CashRegister followed by a colon, a space, and a dollar symbol followed by
the total amount of money in this cash register.
What comes next is the number of loonies. We'll start with one and then add the
number of toons and fives. Oops, I forget myself.
Then comes the number of tens, and finally twenties.
Last, we need a closing parenthesis. It's time to try running it and there's
an error. We see here that we have a type error.
We can't convert into object to Stir implicitly.