100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
OCR Computer Science (complete set) $4.23
Add to cart

Class notes

OCR Computer Science (complete set)

1 review
 187 views  10 purchases
  • Course
  • Institution
  • Book

A complete set of notes of OCR A-Level Computer Science H446 which I used ot achieve an A*. Also contains answers for the PG Online Textbook and both Hodder Education Workbooks. Please note structure and function of the processor and systems software are hand written but everything else has been ty...

[Show more]

Preview 8 out of 344  pages

  • June 28, 2019
  • 344
  • 2017/2018
  • Class notes
  • Unknown
  • All classes

1  review

review-writer-avatar

By: guest9 • 2 year ago

amazing

avatar-seller
Paper 1 - Application generation
Paper 1 - Boolean algebra
Paper 1 - Compression, encryption and hashing
Paper 1 - Computer related legislation
Paper 1 - Data types
Paper 1 - Databases
Paper 1 - Development Methadologies
Paper 1 - Hodder education workbook answers
Paper 1 - Input, output and storage
Paper 1 - Moral and ethical issues
Paper 1 - Networks
Paper 1 - Structure and function of the processor
Paper 1 - Systems software
Paper 1 - Web technologies
Paper 1 & 2 - Data structures
Paper 1 & 2 - Types of programming languages
Paper 2 - Algorithms
Paper 2 - Computational methods
Paper 2 - Computational thinking
Paper 2 - Hodder education workbook answers
Paper 2 - Programming techniques
PG Online textbook answers

,SLR4


The nature of applications
Types of software:
1. System
2. Utilities
3. Application
Application software: allows user to carry out a task / aids them on producing something on a
computer.
Application: “Any program, routine or procedures (together with their associated documentation) that
can be run on a computer system.”
Common examples:

Word processors Documenting work, writing letters, legal
documents
Desktop publishing Creating posters / newspapers / magazines /
brochures
Spread sheets Managing finances, calculations
Database management Sorting, storing and managing client’s
information
Email client / communication software Communicating between clients and
departments
Slideshow / presentation Providing visual aid when presenting work




Factors that you would consider when choosing one program other another (e.g. MS Word instead of
Libre Writer):
1. Speed
2. Cost
3. Hardware / software requirements (e.g. only Mac)
4. Memory requirements (not enough RAM)
5. Compatibility (must use MS Word for school)
6. Convenience (someone who uses Google Drive will most likely also use Google Docs)

,SLR4


Utilities
Utility software: normally small programs which have a specific purpose (normally to maintain the
computer)
Utilities: “Any program, routine or procedures (together with their associated documentation) that can
be run on a computer system.”
1. Antivirus: help to detect and remove malicious programs
2. Disk defragmentation software: puts associated data next to each
other on a hard disk so the hard drive can read data faster (as the
disk will make less rotations before all the data is read)
3. Compression software: reduces amount of physical space files
take up when stored
4. File managers: allows users to easily copy, delete, rename or
modify files and directories on a computer
5. Firewalls: help to prevent unauthorised access to a computer system / network. Schools and
other organisations also use firewalls to prevent internal computers accessing inappropriate
content
6. Backup software: manual or automatic backups (e.g. to another disk, removable disk, network
file server or cloud storage)

,SLR4


Open vs closed source software
Open source:

• “Software for which the original source code is made freely available and may be
redistributed and modified. – Open source file types are often able to be opened on many
different types of applications.”
• Public can view, edit and redistribute source code
• Normally free
• Encourages mass user development
• Promotes creativity and sharing
Closed source (aka proprietary software):

• “Often called Proprietary is a type of computer program for which the software code is not
shared with the public for anyone to look at or make changes to – Closed / Proprietary file
types are often only able to be opened if you own a version of the software they were
originally made in.”
• Supplied pre-compiled
• Source code not freely available
• Often copyrighted
• Often costs money




Source code: “Original code typed in by the programmer in the native language. This is the code as it
appears before it is compiled or interrupted.”

,SLR4


Translator
Converts source code into machine code
1. Assembler: converts low-level assembly language directly into machine code
a. normally 1 to 1 relationship e.g. 1 line in assembly = l line of binary
b. Cannot be transferred across different systems (because assembly code is processor
specific)
2. Compilers: converts whole of high level source code into object code
a. One to many relationship e.g. 1 line in VB = many lines of binary
b. Initial compilation process is slow
c. Object code can be distributed to lots of different systems
d. Only object code needs to be distributed
3. Interpreters: convert 1 line of high level source code at a time directly into machine code
a. One to many relationship e.g. 1 line in VB = many lines of binary
b. Good for debugging
c. Requires access to whole source code to execute
d. Slow to execute

,Stages of compilation
Stage 1: Lexical analysis
ORIGINAL SOURCE CODE:
Function higher(num1 As Decimal, num2 As Decimal, clip As Decimal)
'Function to return the higher of two numbers
'Clipped at the value of clip
Dim result As Decimal

If num1 > num2 Then result = num1
If num2 >= num1 Then result = num2
If result > clip Then result = clip

Return results

End Function

Sub Main()
'Return the higher of the two numbers, clipped at 6.
Console.WriteLine(higher(3, 7, 6))
Console.ReadLine()
End Sub
i. Remove white spaces
Functionhigher(num1AsDecimal,num2AsDecimal,clipAsDecimal)
'Functiontoreturnthehigheroftwonumbers
'Clippedatthevalueofclip
DimresultAsDecimal
Ifnum1>num2Thenresult=num1
Ifnum2>=num1Thenresult=num2
Ifresult>clipThenresult=clip
Returnresult
EndFunction
SubMain()
'Returnthehigherofthetwonumbers,clippedat6.
Console.WriteLine(higher(3,7,6))
Console.ReadLine()
EndSub
ii. Remove all comments
Functionhigher(num1AsDecimal,num2AsDecimal,clipAsDecimal)
DimresultAsDecimal
Ifnum1>num2Thenresult=num1
Ifnum2>=num1Thenresult=num2
Ifresult>clipThenresult=clip
Returnresult
EndFunction
SubMain()
Console.WriteLine(higher(3,7,6))
Console.ReadLine()
EndSub
iii. Change keywords into tokens by looking up commands in a table. Report commands not found as errors
Fnhigher(num1AsDecimal,num2AsDecimal,clipAsDecimal) Console.Readline Cr
DiresultAsDecimal Console.Writeline Cw
Ifnum1>num2Thresult=num1 Dim Di
Ifnum2>=num1Thresult=num2 End Function Ef
Ifresult>clipThresult=clip End Sub Es
Reresult Function Fn
Ef If If
SuMain()
Return Re
Cw(higher(3,7,6))
Sub Su
Cr()
Then Th
Es
iv. Check variable names match the rules of the language and replace them with tokens in the symbol table
Fnh(o,t,c) Token Variable Datatype
Dir h higher Function
Ifo>tThr=o o num1 Decimal
Ift>=oThr=t t num2 Decimal
Ifr>cThr=c c clip Decimal
Rer r result Decimal
Ef m Main() Sub routine
Sum()
Cw(h(3,7,6))
Cr()
Es

,SLR4


Stage 2: Syntax analysis

• “The stage in compilation where language statements are checked against the rules of the
language, errors being reported if a statement is not valid.”
• Syntax of program is checked against the rules
• Abstract syntax tree is created
• If any of the tokens break the syntax rules errors are generated
Stage 3: Code generation

• “The stage in compilation that produces a machine-code program that is equivalent to the
source program.”
• Syntax tree converted into object code
Stage 4: Code optimisation

• “The stage in compilation where language statements are checked against the rules of the
language, errors being reported if a statement is not valid.”
• Code optimised
• e.g. removing redundant code (such as variables declared but never called)

, SLR4


Linkers, loaders and libraries




Libraries:

• “A collection of pre-compiled routines which can be incorporated into a program.”
• Developer must reference library to use the routines (e.g. import time in Python)
• Normally packaged into categories (e.g. time, random and datetime in Python)

Linker: includes links to any libraries that are required (merging everything into a single executable
file) - aka static linking
Static linking: all of code required directly included into single executable file (results
in large file sizes)
Dynamic linking: compiled versions of libraries already stored on computer.

• The OS links to library code directly into the program when it is run.
• Smaller executable files
• Libraries are not duplicated multiple times
• Loader (part of OS) will load the different pieces of code into memory when dynamic linking
is used
“Loaders are simply responsible for loading a program into memory, and are part of the operating
system. It handles the addresses when the program is run.”

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller halfpint. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $4.23. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

50843 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$4.23  10x  sold
  • (1)
Add to cart
Added