Internet 101

Quite a few students have been asking for a better explanation of how the Internet works. This sequence of videos takes you through all areas and aspects of the Internet. If you have a Khanacademy account (you do S4) then you can even earn a badge for watching the videos.

It is well worth a watch for National 4,5 & higher and it will now be making up part of our future courses.

FizzBuzz

So I was reading a programming blog from a few years ago that was asking, why can’t programmers.. program?. The article set a challenge to

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

Now technically the answer to the puzzle uses nothing more than Nat 5 constructs, so can you code a Python solution? Share it here if you get a nice one

(hint after the jump)

Read more

Higher – SSD Functions

Still a lot of confusion over the  definition of a function and procedure in Higher Computing Science and how they differ.

A procedure is a sub program that contains a block of code. It uses parameters to pass data to and from the main program.

A function is a sub program that contains a block of code. It uses parameters to get data from the main program and passes back a single piece of data using RETURN.

In the program below you can see a procedure called calcArea and a function called funcArea. Both of these sub programs do the same thing but they way the work is different. The last two lines of code could be merged into

MsgBox(“Function Area =”  & funcArea(10,11)).

The procedure is always called on it’s own. Can you name another function shown in the program below?

 

functions

 

Higher – Revision for Friday 18th of March

Please look over the following SSD areas

Be able to name and describe how the following standard algorithms work.

  • Linear Search
  • Input Validation
  • Find Maximum
  • Count Occurrences
  • Find Minimum
  • Reading from a file

Describe how the following translators work

  • Interpreters
  • Compilers

Differences between high and low level languages

How to use a subprogram

Use of parameters in subprograms

Differences between functions and procedures