Here we've got the instructions that I would
have expected you to have created for the
mortgage problem. I've done this in two different
ways. Firstly here using the amounts for the
deposit and then here using the amounts for
the total cost of the house. Either way is
fine. So let's discuss what I've done here.
So here I've done it in separate blocks of
code, whereas here I've just put it altogether.
Again, either is fine. So let's look at these
separate blocks here. So if I click on this
first block of code, this should just draw
the first line and get the sprite back down
the bottom to draw the first slice of pie
chart. So let's look at that, yeah. Now we've
got to draw this first slice of pie chart,
which represents the amount that the Bradshaw
family put towards the deposit of the house.
So they put in £2,000 out of £15,000. So
if we click on that, that will draw this slice
of pie that represents what they put in for
the deposit. Now we want to draw the slice
of pie that shows us how much the Ahmed family
put in towards the deposit. So they put in
£8,000 out of £15,000, multiply that by
360, because obviously Scratch needs to work
out the degrees. And if we click on that,
that will create this next slice of pie chart.
Now because we've only got one more slice
left to create, this is already done for us.
But we want to get the sprite back up into
the right position in case we needed to do
something else. So we put in here that the
Chowdhury family contributed £5,000 out of
£15,000. So if we click on that, that has
gone through that angle and has got the sprite
back into that position. Now what I want to
do is to show you that this code here, these
instructions here, give you exactly the same
pie chart. So let's move the sprite over here.
And all I've done here is I've just literally
joined these up, but changed the amounts here
so this represents the Bradshaw family putting
in £16,000 out of the total amount £120,000,
the Ahmed family putting in £64,000 out of
the total price of the house and the Chowdhury
family putting in £40,000 out of the total
price of the house. So if we click on this
code here, we will see exactly the same pie
chart. So it doesn't matter whether you've
used the values for the deposit or you've
used the values for the total price of the
house, you will get exactly the same looking
pie chart as these have been worked out in
proportion.
