COMP 121 In-Class Assignment
September 5, 2008
1.
If you
like, you may do this exercise with a partner.
2.
You’ve
done Tutorial 3-5 and saved it. Open
that world now (it should be the one with the snowman and snowWoman,
where he asks her if she comes there often).
Add instructions at the end of the program to make it do the following:
a.
Have
the snowman ask the snowWoman if she wants to order a
pizza
b.
Add a
variable named wantPizza
and ask the user if the snowwoman wants a pizza
c.
If the
user says the snowWoman does want a pizza, she should
say Sure!; otherwise, she should say No, thanks.
d.
Add
more instructions to the part where she does want a pizza. In that case, the snowman should ask the user
what diameter pizza they should order.
He should then calculate the area (remember, the area of a circle is πr2,
and you calculate the radius r by dividing the diameter by 2), divide it by 2
and say (for example), If we order a 12
inch pizza, we each get 56.519999999 square inches!