# All posts by Mr Stratton

Computing teacher and a PT at Coltness High School.

# Skinning the Glow group.

OK so I was reading this blog entry and I thought to myself “You know some of the higher class might want a crack at that!”. If you fancy creating a skin for our glow group then come and talk to me and we can share some ideas.

Here is a little something to make you think

# 2010 Short Paper feedback

Today’s lesson was feed back from Tuesday’s short paper.

Please look over the paper and answers. Make sure that you have studied the questions that you did not get full marks on so you can improve your answers in the future.

You can find the papers and answers here

# Homework due Tue 2nd Nov

Design a program that displays a times table that the user enters.
Design MUST have data flow indicated.

# Code for Corrie

Option Explicit

Private Sub Command1_Click()
‘Set up variables
Dim NumA As Single
Dim NumB As Single

Call Get2Numbers(NumA, NumB)
Call DisplaySum(NumA, NumB)

End Sub

Sub Get2Numbers(ByRef NumA, ByRef NumB)
NumA = InputBox(“What is the first number”)
NumB = InputBox(“What is the second number”)
End Sub

Sub DisplaySum(ByVal NumA, ByVal NumB)
MsgBox (NumA + NumB)
End Sub

# Introduction to Arrays

Today’s lesson introduced 1-D arrays. The class started off by creating 3 programs.
1. Create a program to take in 3 numbers and display the sum and average.
2. modify the program to work with 5 numbers.
3. Modify the program to display the numbers after it displays the sum and average.

The class were given the main steps and asked to refine it, before starting the task. Each task was to be saved in separate folders.

The class was then asked to modify the program for 100 numbers. This led to discussion about the need for a new data type that could store a list of values, this data type is called Array.

Scratch was used to show how arrays can be used. The class then looked at the DIM command’s help page to discover how to set up an Array.

DIM IntNumber(50) as Integer

Where (50) is the number of items in the array.

The program was modified to allow entry of 100 values before the period finished.

HOMEWORK

Write the refinements for the main program given for 100 numbers.

1. Set up Variables
2. Get 100 values from user
3. Calculate Average and Sum of values
4. Display the Average, Sum and values
5. End program