I have removed these from pupils temporarily . I will reinstate them next week once you have had a little more training 🙂
All posts by Mr Stratton
New Logo
Topics to look up for resit
For those unlucky enough to have failed the NAB make sure you look over all your notes. You might want to focus on the following areas.
- Evaluation Vocab
- Types of maintenance
- Local / Global Variables
- Compilers & Interpreters
- Scripting language examples
- Bottom up design
You have your Scholar & Glow usernames and passwords so get on the sites and do some research.
Homework Due 22/11
SQA Past paper 2007 Section 2 questions 20 & 21. Please don’t use the solutions on the web, that defeats the point of homework. If you don’t know it, go research it, you have the world’s biggest library at your finger tips.
Software Development NAB
The NAB was carried out today on paper. I used Solar last year but I felt there was a bit of a disconnect between me and the assessment.
Back to the old ways for this year anyway.
Today’s Revision
Make sure you have given Scholar’s end of topic assessment a go as this will help focus your last minute study.
Software Development Revision
Homework for Tue 8th Nov 2011
- Write the pseudocode for the part of the program which checks that the grade entered is a number between 1 and 7. (You should not need all the lines given!)
- Write the Visual BASIC line of code which displays a message box if an invalid grade is entered. The grade is stored in a variable called grade.
- Write the Visual BASIC line of code which displays a message box showing “Int 2” when the grade entered is either a 3 or a 4. The grade is stored in a variable called grade.
- Explain briefly what each of the following algorithms does:
- Input validation
- Finding a maximum
- Finding a minimum
- Counting occurrences
- Linear search
4b. Write the pseudocode for the algorithms above
5. An array can be used to store variables. Explain what an array is, by using an example.
- The values I am going to store in my example are:
- I am going to create my array using this line of Visual BASIC code:
- My array works like this:
Dice Roll Program
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'1 Set up Var
Dim dice(6000) As Integer
Dim results(6) As Integer
Dim target As Integer
'2 Roll 6000 dice
Call RollDice(dice)
'3 For Each Side of the dice
For Target = 1 To 6
'4 Count each side
Call count_occurrences(Target, dice, results(Target))
'5 next
Next
'6 Display
Call Display(results)
End Sub
Private Sub RollDice(ByRef dice() As Integer)
Dim counter As Integer
Randomize()
For counter = 1 To 6000
dice(counter) = Int(Rnd() * 6) + 1
Next
End Sub
Private Sub count_occurrences(ByVal target As Integer, ByRef Int_array() As Integer, ByRef counter As Integer)
'counting occurrences with an array of 10 strings
Dim pointer As Integer
counter = 0
For pointer = 1 To 6000
If Int_array(pointer) = target Then counter = counter + 1
Next
End Sub
Private Sub Display(ByRef results() As Integer)
Dim Counter
'clear listbox
lstOutput.Items.Clear()
'Display
For Counter = 1 To 6
lstOutput.Items.Add(Counter & vbTab & results(Counter))
Next
End Sub
End Class
Homework for 2/11/11
Sorry folks, I need to remember to check that automatic tasks launch, when they are meant to.
- What is meant when software is said to be modular?
- What is the disadvantage in using GLOBAL variables?
- What is the advantage in using LOCAL variables?
- Describe what a local variable is used for.
- Why should care be taken when using global variables?
- Give an extract of code which illustrates how a formal and actual parameters are used.
- Illustrate the difference in syntax between procedures/subroutines and functions.
- What is the advantage in using subprograms?
- Describe parameter passing by value.
- Describe parameter passing by reference.