Category Archives: Computing Higher

Interface Homework

This weeks homework is in Glow learn but here is an offline copy

  1. Describe two ways in which buffers improve system performance
  2. Describe a situation in which spooling would be a useful technique
  3. Give reasons why solid state memory devices are so widely used
  4. Why does an interface have to convert incoming serial data to parallel form?
  5. Why is a buffer an essential part of an interface

For practice – do as an exercise but no need to hand in

Describe a suitable selection of hardware including peripherals to suit the tasks below

  • Producing a school website
  • Setting up a LAN at home
  • Creating a multimedia reference DVD

Notes List

You should now have the following core notes.

Software Development

  • Topic 1 Getting started
  • Topic 2 Strings and Branches
  • Topic 3 Loops (revision)
  • Topic 4 1-D Arrays (revision)
  • Topic 5 User-defined functions
  • Topic 6 Sub-programs and parameter passing
  • Topic 7 Standard Algorithms
  • Topic 8 Real-world Programming
  • Topic 9 Programming tools

Computer Systems

  • Topic 1 – Data representation
  • Topic 2 – Computer Structure
  • Topic 3 – Computer Performance
  • Topic 4 – Peripherals
  • Topic 5 – Networking
  • Topic 6 – Using Networks
  • Topic 7 – Systems Software
  • Answers
  • Glossary

Interfacing

Today we learned about interfacing which is making the appropriate connections so that two pieces of equipment can communicate or work together effectively.

The example shown was a Kinect.

The types we learned about were serial interfacing where data is sent individually and parallel where it is sent in multiple bits.
We also discussed analogue and digital interfacing.

We were then handed out the rest of the notes.

Procedures and Functions!

Hi! Today’s lesson was based mostly on basic functions but for the start of the lesson the class discussed the new terms of Actual and Formal Parameters.

Here is a small section of code that incorporates these two terms:

Call Doubler(Num)
Private Sub Doubler(ByVal N As Single)

The parameter used in the calling statement is properly known as the actual parameter. The actual parameter is what is passed to the procedure.
The parameter listed in the procedure heading is properly known as a formal parameter. The number, order and type of formal parameters must match the actual parameters, but their names can be different.

The rest of the lesson was to do with SD booklet 5 – User defined functions. Mr Stratton said that many of the functions would never appear in the exam but some important functions we might want to take note of were the Ucase function which converts lower-case characters into upper-case characters and the Lcase function which does the opposite. Another important function was the Mid$ function which extracts a sub-string from a string and also featured hugely in our program for the day. I have typed the part of the program for how to create the password below:

‘create the password
name1 = Mid$(name1, 1, 1)
name2 = Mid$(name2, 2, 1)
year = Mid$(year, 3, 2)
colour = Mid$(colour, 2, 2)
street = Mid$(street, 1, 3)
password = name1 + name2 + year + colour + street + shoe_size

Sorry if you get bored reading it all I guess.
Well that all folks!

Design a logo!

We need a new logo for the blog! I would like you to design and create one. It can not use copyright images but can have photos you have taken yourself as well as public domain images.

Attached below is a quick sample I knocked up with powerpoint and irfanview

Program to order computer..

sorry for the late post guys, this relates to the task set on thursday/friday.

Well the task we were given to create should have been finished on friday. The program was complex but there is a solution.

Mr stratton has already posted the solution, but there was another way in which it could have been done, which was instead on using parameter passing, you could just type the program straight in without it,though this would take longer and could then have a lot of problems.

so for the solution look to Mr strattons post previous to this one.

Well guys peace out, live long and prosper….

Solution to 6.5.3 task 1

Ok so this is going to be a long post (I will need to check the blog options and shrink the post sizes). This is a solution to task 1 in 6.5.3 it is based on the design given in the answers. It is NOT the only solution and you might want to comment on ways the program could be improved (think about evaluation). I have included some screen shots.

NOTE the display of the data is optional.

Option Explicit

Private Sub Command1_Click()
'This program represents a solution to 6.5.3 task 1
'The Desgin was given in the answers section
'It is not the only solution
Dim HD_up As Integer 'HD Upgrade required
Dim RAM_up As Integer 'RAM Upgrade required
Dim Mon_up As Integer 'Monitor Upgrade required
Dim Cost1 As Single 'Price
Dim Num As Integer 'Quanity
Dim Basic_Cost As Single 'Cost for Order before deliver and discounts
Dim Dis As Single ' Discount on whole order
Dim Del As Single ' delivery charge per order
Dim VAT As Single 'VAT on Order
Dim Total As Single ' Order Total
Cost1 = 499 'Set the starting cost of a machine
Del = 50 ' £50 delivery per order
Form1.Print "The basic systems costs 499" 'optional
Call Get_Comp_Spec(HD_up, RAM_up, Mon_up)
Call Calc_Cost_Of_One(Cost1, HD_up, RAM_up, Mon_up)
Call Get_Number(Num)
Call Calc_Basic_Cost(Num, Cost1, Basic_Cost)
Call Calc_discount_delivery_VAT(Num, Basic_Cost, Dis, Del, VAT)
Call Calc_total_cost(Basic_Cost, Dis, Del, VAT, Total)
Call Display_total(Total)
End Sub

Private Sub Get_Comp_Spec(ByRef HD_up As Integer, ByRef RAM_up As Integer, ByRef Mon_up As Integer)
'Check what upgrades the user wishes
HD_up = MsgBox("Do you wish to upgrade to 60GB for £30?", vbYesNo)
RAM_up = MsgBox("Do you wish to upgrade to 1GB for £50?", vbYesNo)
Mon_up = MsgBox("Do you wish to upgrade to 21 inch for £199?", vbYesNo)
End Sub

Private Sub Calc_Cost_Of_One(ByRef Cost1 As Single, ByVal HD_up, ByVal RAM_up, ByVal Mon_up)
'calculate the cost of the upgrades
If HD_up = vbYes Then
Cost1 = Cost1 + 30
Form1.Print "Hard drive upgrade £30" 'optional
End If
If RAM_up = vbYes Then
Cost1 = Cost1 + 50
Form1.Print "RAM upgrade £50" 'optional
End If
If Mon_up = vbYes Then
Cost1 = Cost1 + 199
Form1.Print "Monitor upgrade £199" 'optional
End If
End Sub

Private Sub Get_Number(ByRef Num As Integer)
'Get the number of systems ordered
'As an extension task this number could be validated
Num = InputBox("How many machines do you want?")
Form1.Print Num & " machines ordered" 'optional
End Sub

Private Sub Calc_discount_delivery_VAT(ByVal Num, ByVal Basic_Cost, ByRef Dis As Single, ByRef Del As Single, ByRef VAT As Single)
'Calculate Discount
If Num > 10 And Num <= 20 Then
Dis = Basic_Cost * 0.05 '5% Form1.Print "A discount of 5% is £" & Dis 'optional
ElseIf Num > 20 Then
Dis = Basic_Cost * 0.1 '10%
Form1.Print "A discount of 10% is £" & Dis 'optional
Else
Dis = Basic_Cost * 0 '0%
Form1.Print "A discount of 0% is £" & Dis 'optional
End If
'Calculate VAT
Form1.Print "Delivery on the order is £" & Del 'optional
VAT = (Basic_Cost - Dis + Del) * 0.175
Form1.Print "The VAT on the order is £" & VAT 'optional
End Sub

Private Sub Calc_Basic_Cost(ByVal Num, ByVal Cost1, ByRef Basic_Cost As Single)
'Calculate the cost of the order before discount and VAT
Basic_Cost = Num * Cost1 ' Cost for whole order
Form1.Print "The cost of the order before discount,deliver & VAT is £" & Basic_Cost 'optional
End Sub

Private Sub Calc_total_cost(ByVal Basic_Cost, ByVal Dis, ByVal Del, ByVal VAT, ByRef Total As Single)
'Calculate the Total cost of the whole order
Total = Basic_Cost + Del + VAT - Dis
End Sub

Private Sub Display_total(ByVal Total)
'Display the cost for the whole order
Form1.Print "The total for the order was £" & Format(Total, "0.00")
End Sub

Displaying 20 Names and Marks in An Array

Today we were given the task of adapting Fridays program to display 20 names and scores from a listbox as well as working out the average mark as a percentage, in another one of Mr Strattons trademark programming tasks. As usual we were let loose on the computers, where, after 15 minutes of confusion and entering paragraphs of code, Mr Stratton questioned us as to who had actually jotted down a design before implementing it. He eventually posted a possible solution which is shown below:

Private Sub CmdStart_Click()
‘load an Array with data from a list box
‘list box is hidden on the form
‘List Boxes count from 0 so add a heading to the fist item
Dim IntNumber(20) As Integer
Dim StrName(20) As String
Dim intavg As Integer
Call Load_Array(IntNumber(), StrName())
Call Calc_Average(IntNumber(), intavg)
Call Display_Array(IntNumber(), StrName(), intavg)
End Sub

Private Sub Load_Array(ByRef Number() As Integer, ByRef StrName() As String)
Dim Counter As Integer ‘local Variable
For Counter = 1 To 20
Number(Counter) = LstNumbers.List(Counter)
StrName(Counter) = LstNames.List(Counter)
Next
End Sub

Private Sub Calc_Average(ByRef IntNumber() As Integer, ByRef intavg As Integer)
Dim IntSum As Integer
For Counter = 1 To 20
IntSum = IntSum + IntNumber(Counter)
Next
intavg = IntSum / 20
End Sub

Private Sub Display_Array(ByRef Number() As Integer, ByRef StrName() As String, ByVal intavg)
‘Standard procedure as used in previous programs
Dim Counter As Integer ‘local Variable
For Counter = 1 To 20
Form1.Print StrName(Counter) & ” scored ” & Number(Counter) & “%”
Next
Form1.Print “Average = ” & intavg & “%”
End Sub

And thats it folks, I’ll leave Danielle to fill you in with the rest.

VB Program for Displaying the Average of 20 Marks

Below is the program from today’s lesson. It is not completed, I would like you to Change the program to display the average with two decimal places. Please add your solution with a comment below.

Private Sub CmdStart_Click()
'load an Array with data from a list box
'list box is hidden on the form
'List Boxes count from 0 so add a heading to the fist item
Dim IntNumber(20) As Integer
Dim StrName(20) As String
Dim intavg As Integer
Call Load_Array(IntNumber(), StrName())
Call Calc_Average(IntNumber(), intavg)
Call Display_Array(IntNumber(), StrName(), intavg)
End Sub

Private Sub Load_Array(ByRef Number() As Integer, ByRef StrName() As String)
Dim Counter As Integer 'local Variable
For Counter = 1 To 20
Number(Counter) = LstNumbers.List(Counter)
StrName(Counter) = LstNames.List(Counter)
Next
End Sub


Private Sub Calc_Average(ByRef IntNumber() As Integer, ByRef intavg As Integer)
Dim IntSum As Integer
For Counter = 1 To 20
IntSum = IntSum + IntNumber(Counter)
Next
intavg = IntSum / 20
End Sub

Private Sub Display_Array(ByRef Number() As Integer, ByRef StrName() As String, ByVal intavg)
'Standard procedure as used in previous programs
Dim Counter As Integer 'local Variable
For Counter = 1 To 20
Form1.Print StrName(Counter) & " scored " & Number(Counter) & "%"
Next
Form1.Print "Average = " & intavg & "%"
End Sub