In this task, you're going to use your programming skills to print the words to the children's song The Twelve Days of Christmas. If you missed the first task, click here for instructions on how to install Just BASIC.
If you can't remember how the song goes, or would like to read more about it, have a look at the Twelve Days of Christmas Wikipedia page.
Now you're getting better at programming, I'm going to give you less help. I will tell you, though, that I would use at least one array to store the names of the gifts - although you might use more if you want to do the extension task.
This is quite a bit more tricky that Ten Green Bottles. Think carefully about how the song is structured. There are twelve days, and on each day you need to mention all of the gifts you've received so far, so on the first day you mention one present, then on the second day you get the next present and are reminded of the first one, and so on. So your program needs to count up to twelve, but what else does it need to do?
Your task is to produce a program to print the words to the song The Twelve Days of Christmas. Your program should:
be efficient and use a loop - it shouldn't just PRINT the whole song
correctly list all of the presents (in the correct order) so far
consider how to lay out the words to make the song clear and easy to read
My daughter's year 2 Christmas homework was to work out how many presents were given altogether. Could your program work that out? You could also show the number of presents on each day so that the user can see where the total comes from.
You can use any other programming tricks you've learnt to improve the program. You could try, for example, to display the numbers of presents and the number of the day in words, rather than digits - e.g. "On the second day of Christmas my true love sent to me two turtle doves...".