Well it looks like our Tuesday bloggers have let us down đ
Today’s lesson was to create a program to store 50 random number in an array and then to display that array in reverse. Once the task was given the pupils were asked to solve the problem. Most went straight to the computer and never thought about analysis or design, this led to confusion about the task and pupils were brought back and the task discussed again.
The Main steps were given to the pupil
- Set up variables
- Populate list with random numbers
- Create reverse list
- Display forward and reverse lists
- end program
After discussion we had the following refinements for step 2
- For 50 numbers
- Generate random whole number between 1 and 20
- Store number at next location in Array
- Next
In VB this is written as
For IntCounter = 1 to 50
IntNumber=int(rnd*20)+1
IntForward(Intcounter)=IntNumber
Next