A for loop is used to repeat a section of programming code more than once. It is an unconditional loop, that is, it can not be stopped by the user.
Below we can see how this is written in pseudocode
It is fairly easy and quick in scratch to create an advent calender.
If it’s so easy then why do I have a video on it? Watch and see after the jump
How can we work of the average height of a group of trees?
[kml_flashembed movie="http://www.youtube.com/v/O7uyoLAKY8A" width="425" height="344" allowfullscreen="true" fvars="fs=1" /]
Create a program that simulates an electronic till.
The operator must enter the pin 1066 to get access before entering all of the items in the basket (3 baskets below). To finish a basket the operator enters a price of zero, the program will then display the total and ask for the cash tendered before displaying the change and going on to the next basket.
Basket 1 | Basket 2 | Basket 3 |
£0.67
£0.99 £0.34 £0.99 £0.78 £0.65 £0.12 £0.15 |
£1.99
£12.99 £1.50 £5.43 £8.99 |
£0.54
£1.99 £0.01 £18.99 £192 £67.50 £24.99 |
Modify the times table program to display all twelve of the times tables. Answer after the break!
Hint: you want to repeat the times table twelve times
After last weeks struggle over the IF statement and REPEAT loops, I thought a little refresher might be in order.
Today’s lesson was taken from the Scratch Your Nose website. We opened the Pong tutorial and followed it to create the game. Time was spent in the lesson looking at the roles Variables, the IF statement and REPEAT loops had in the program.
We then went on to expand the game but increasing the difficulty and adding sound.
Extension tasks after the break.
Well a few of you found this tough going, here is the solution.
You have to modify the program
You have to create a program that generates a random number between 1 and 15. The user has to make as many guesses as they need to get the correct number. To make it easier on the user, the computer will tell them if each guess is higher or lower.