Category: Old Higher

Higher – Data Types and Structures (Revision)

  • String: text (str)
  • Integer: whole numbers (int)
  • Real: decimal numbers (float)
  • Boolean: one of two possible values e.g. True/False
  • 1-D Arrays: two or more values of the same data type stored in the same construct
  • Records: two or more values of different data types stored in the same construct
  • Sequential Files: text files that can be opened, closed, read from, written to, created or deleted; identified by a path and filename which is treated as a STRING e.g. “n:\myfiles\testfile.txt” would identify the file testfile.txt in the folder n:\myfiles.

 

Thank you to C O’Toole & A Madill from Braidhurst High School for allowing me to publish this here.

Higher – Computational Constructs (revision)

  • Parameter passing: used to pass data from one subprogram to another; can either be passed by value (data will not change) or by reference (changes to the data will be made)
  • Variable scope: where a variable can be used in a program; local (only inside the subprogram in which the variable has been created) or global (can be used in any subprogram)
  • Subprograms: named blocks of code which can be run from within another part of the program; often used to break a large program into smaller steps
    • Functions: a type of subprogram used to return a single value eg round, random
    • Procedures: a type of subprogram that will follow a set of given instructions
    • Methods: a function in an object-oriented language that is defined inside a class

Thank you to C O’Toole & A Madill from Braidhurst High School for allowing me to publish this here.

Higher – Languages and Environments (Revision)

·         Low-level: language that a computer will understand; consists of 0s, 1s; examples include assembly code and machine code

·         High-level: language that a human will understand; use of English words such as repeat, if, loop, put

·         Procedural: code will processed logically and in a set order; passes data from one procedure to another using parameters

·         Declarative: consists of a knowledge base of facts and rules that can be queried

·         Object-Oriented: objects are created using classes that will contain code and data (encapsulation); data associated is known as attributes and its values are known as states; sub-classes can inherit attributes from a pre-defined class

·         Interpreter: takes each line of source code, translates it into machine code then passes it to processor to carry out that instruction; it works its way through the program one line at a time

Advantages Disadvantages
A program will run even if it is not finished No copy of machine code is saved meaning the source code has to be translated every time taking longer
Easy to spot errors during the translation The process of translating the program slows down the running of it
Program will run as soon as the first line is translated You will need to have a translator program or you cannot run it

·         Compiler: reads the source code and translates the entire program into machine code once; machine code then saved and kept and doesn’t need to be further translated before run

Advantages Disadvantages
The machine code is saved so the program only needs to be translated once You have to wait until the code is complete and the errors have been fixed before the translation can be finished and the machine code is run
The user does not need a translator program to run the machine code therefore the program runs quicker Each time the program is changed it needs to be re-translated

Thank you to C O’Toole & A Madill from Braidhurst High School for allowing me to publish this here.

National 5 & Higher Course Content

You have a paper copy of this in your folders but I thought you might want an electronic copy.

The document is divided into

  • Yellow (SDD)
  • Orange (SDD & ISDD)
  • Red (ISDD)

For the exam National 5 pupils could be asked question from National 4 & 5. Higher pupils can be asked about content from all three courses.

TIP: Take a highlighter and mark of areas as you study them, use traffic lights to mark areas you need to come back to.

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.

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 – Responsive web design in PagePlus X8

Not everyone uses a desktop computer to view web pages. A significant proportion of the population now uses mobile devices to view websites. This means that designers have to use a website design that can respond to these devices by changing page size, position of elements, etc. Normally this would be done with CSS scripting however the process is slightly different in WebPlus.