Applications Generation (OCR A Level Computer Science)

Exam Questions

14 mins5 questions
11 mark

A small manufacturing business uses networked computers with closed source application software installed.

A spreadsheet application package is used to calculate employee’s wages.

Give one benefit of using a spreadsheet application for this task compared to calculating wages manually.

Did this page help you?

21 mark

A programmer creates this function shown in Fig. 5 using a high-level language.

function mystery(x,y) 
  total = x + y 
  while x >= 10 then 
     x = x – 10 
     y = y – 10 
     total = total + x + y 
  endwhile 
  return total 
endfunction

Before the code in Fig. 5 can be executed, a translator must be used.

State the purpose of a translator.

Did this page help you?

33 marks

When Imogen creates programs in a high-level language, she makes use of libraries.

Explain what is meant by a library, giving one example of when one may be used.

Did this page help you?

45 marks

For each statement shown in Table 5, tick (✓) one box in each row to indicate which stage of compilation each action takes place at.

Lexical analysis

Syntax analysis

Code generation

Comments and whitespace are removed

Keywords are replaced with tokens

Object code is created

Symbol table created for variables

Builds an abstract syntax tree

Table 5

Did this page help you?

54 marks

Explain two differences between a compiler and an interpreter.

Did this page help you?