Programming Languages & Integrated Development Environments (IDEs) (OCR GCSE Computer Science)

Exam Questions

46 mins14 questions
1a1 mark

A computer game is written in a high-level programming language.

State why the computer needs to translate the code before it is executed.

1b4 marks

Either a compiler or an interpreter can translate the code.

Describe two differences between how a compiler and an interpreter would translate the code.

Difference 1

Difference 2

Did this page help you?

22 marks

Define a low-level programming language?

Did this page help you?

31 mark

State the primary advantage of high-level programming languages?

Did this page help you?

41 mark

Define the role of an assembler?

Did this page help you?

15 marks

Complete the description of programming languages and translators by writing the correct term from the box in each space.

A table containing words in three rows and five columns. Words include: continues, crashes, debugging, error, executable, high-level, interpreter, language, low-level, many, no, one, stops, with, without.

Jack writes his program in a ........................................ language. This needs to be translated into assembly or machine code before it can be executed. This is done using a translator.

One type of translator is an interpreter. This converts one line of code and then executes it, before moving to the next line. It ........................................ when an error is found, and when corrected continues running from the same position. This translator is helpful when debugging code.

A second type of translator is a compiler. This converts all of the code and produces an error report. The code will not run until there are ........................................ errors.

The ........................................ file produced can be run ........................................ the compiler.

Did this page help you?

22 marks

The area of a circle is calculated using the formula π × r2 where π is equal to 3.142 and r is the radius.

A program is written to allow a user to enter the radius of a circle as a whole number between 1 and 30, then calculate and output the area of the circle.

01 radius = 0 

02 area = 0.0 

03 radius = input("Enter radius") 

04 if radius < 1 OR radius > 30 then 

05     print("Sorry, that radius is invalid") 

06 else 

07     area = 3.142 * (radius ^ 2) 

08 print (area) 

09 endif

An Integrated Development Environment (IDE) is used to write the program

Identify two features of an IDE that might be used when writing the program

Feature 1

Feature 2

Did this page help you?

32 marks

Dru writes the following program using a high-level language.

01 function newscore(a,b) 

02     temp = a*b 

03     temp = temp + 1 

04     return temp 

05 endfunction 

06 score = 18 

07 name = "Dru" 

08 print (score) 

09 print ("name") 

10 print (newscore(score,2)) 

11 print (score)

Describe the advantages of writing the program in a high-level language instead of in assembly language.

Did this page help you?

44 marks

A programmer creates an algorithm using a flow chart.

Q2_Paper 2_May 2019_OCR GCSE Computer Science

The algorithm is written in a high‑level language.

The high level code must be translated into machine code before a computer processor can execute it.

Describe two methods of translating high level code into machine code.

Method 1

Method 2

Did this page help you?

5a2 marks

Victoria is writing a program using a high level language to display the meaning of computer science acronyms that are entered.

The code for her first attempt at this program is shown below.

01 a = input(“Enter an acronym”) 

02 if a == “LAN” then 

03     print(“Local Area Network”) 

04 elseif a == “WAN” then 

05     print(“Wide Area Network”) 

06 …………………………………………………………………………………………… 

07 …………………………………………………………………………………………… 

08 endif

Complete the code above to print out an “unknown” message if any other acronym is entered by the user.

5b2 marks

Describe what is meant by a “high level language”.

Did this page help you?

64 marks

Victoria creates a program using an Integrated Development Environment (IDE).

Describe two tools or facilities that an IDE commonly provides.

Did this page help you?

74 marks

A computer game is written in a high-level programming language.

Either a compiler or an interpreter can translate the code.

Describe two differences between how a compiler and an interpreter would translate the code.

Did this page help you?

16 marks

Explain the differences between low-level and high-level programming languages, and provide one advantage and one disadvantage of each

Did this page help you?

23 marks

Explain why high-level languages are considered portable and give an example

Did this page help you?

33 marks

Compare the memory usage implications of using a compiler versus an interpreter

Did this page help you?