Language Translators (Cambridge (CIE) A Level Computer Science): Exam Questions

Exam code: 9618

1 hour19 questions
1
4 marks

A student uses a laptop to write a program that is saved as a text file.

The program code is written using an Integrated Development Environment (IDE).

(i) One presentation feature found in a typical IDE is prettyprint.

Identify and describe one other presentation feature found in a typical IDE.

(2)

(ii) One debugging feature found in a typical IDE is single stepping.

Identify and describe one other debugging feature found in a typical IDE.

(2)

2
4 marks

A program is written in a high-level language by a team of three programmers using an Integrated Development Environment (IDE).

Describe how the programmers can use the debugging features of a typical IDE during the development of the program.

3a
3 marks

A program has been developed and released for general use. After a few months of use an error is detected where under certain circumstances it outputs an unexpected value.

The program contains a function Lookup(). After investigation, it is found that this is the function that sometimes returns an incorrect value.

An Integrated Development Environment (IDE) is used to help locate the error.

The IDE features of watch window, single stepping and breakpoint will be used.

Explain these features including the order that they will be used in to locate the error in Lookup().

3b
2 marks

To solve the error a programmer decides to create a new module.

The design of the new module has been completed and the module is being coded.

Identify two features of an IDE that will help during the coding of this new module.

4a
2 marks

A software developer is writing a computer program.

The developer uses an interpreter while writing the program code because it is easier for debugging.

Explain one reason why it is easier to debug the program code using an interpreter instead of a compiler.

4b
3 marks

The program is ready to be sold to customers.

The developer uses a compiler because it creates an executable file.

Explain the reasons why the need to create an executable file makes the complier the appropriate choice when the program is complete.

5a
2 marks

A programmer uses an Integrated Development Environment (IDE) to write a computer program. The IDE has both a compiler and an interpreter as built-in translators.

The programmer decides to use the compiler when testing the final program.

Describe the benefits of using the compiler during testing.

5b
6 marks

IDEs have many features other than built-in translators.

Complete the table by identifying one other common IDE feature that can be used for each purpose. Describe how each feature helps the user during program development.

Each feature must be different. Do not give translator as one of your features.

Purpose

IDE feature

Description

for coding

for presentation

for debugging

6a
4 marks

A programmer uses both a compiler and an interpreter to translate a program written in a high-level language.

Describe the advantages of using the interpreter compared to the compiler to translate the program.

6b
1 mark

State one reason why some high-level languages are partially compiled and partially interpreted.

6c
4 marks

(i) Identify two features that support the visual presentation of the code in a typical Integrated Development Environment (IDE).

(2)

(ii) Identify two features that support the debugging of the code in a typical IDE.

(2)

7
4 marks

A programmer uses an Integrated Development Environment (IDE) to develop a program that monitors air quality.

Describe the following features of a typical IDE.

Context‑sensitive prompts ....................................

Single stepping .......................................................

8
2 marks

A programmer writes a program in a high-level language using an Integrated Development Environment (IDE).

The IDE provides features for initial error detection.

Describe how a dynamic syntax check helps the programmer.

9
3 marks

A programmer is working on a program that contains several thousand lines of code.

The Integrated Development Environment (IDE) displays the code using prettyprint.

Explain how prettyprint helps the programmer while the program is being written.

10
5 marks

A programmer is developing a program using an Integrated Development Environment (IDE).

The table describes five problems the programmer has while developing the program.

Complete the table by naming the feature of a typical IDE that solves each problem.

Problem

IDE feature

The programmer types a keyword incorrectly and wants the mistake to be shown on the screen straight away, before the program is run.

The programmer cannot remember the exact name of a built-in function and wants the IDE to offer the possible names while the name is being typed.

The program is now several thousand lines long and the programmer wants to hide the sections of code that they are not working on.

A variable holds the wrong value, and the programmer wants the program to stop running at a chosen line so that the value can be checked at that point.

The programmer wants the current values of several variables to be displayed on the screen while the program runs.

11
2 marks

A software company writes several programs. Each program must be translated before a computer can run it.

Identify the translator needed in each of the following situations.

(i) A program written in assembly language must be translated into machine code.

(1)

(ii) A finished program written in a high-level language must be translated into an executable file that a customer can run without a translator being installed.

(1)

12
3 marks

A programmer writes the control program for a washing machine in assembly language.

Explain why an assembler is needed before the washing machine can run this program.

13
6 marks

A company is working on three programs.

  • Program 1 is written in assembly language and controls a robot arm in a factory.

  • Program 2 is written in a high-level language. A programmer is still writing and testing it.

  • Program 3 is a finished high-level language program that will be sold to customers on a memory stick.

Complete the table by naming the most appropriate translator for each program and giving one reason for each choice.

Program

Translator

Reason

Program 1

Program 2

Program 3

14
2 marks

A finished program written in a high-level language is supplied to customers.

State two drawbacks of supplying this program so that it is run by an interpreter, instead of supplying a compiled version.

15
3 marks

A program is written in a high-level language.

Compare the way a compiler translates the program with the way an interpreter translates the program.

16
5 marks

A company has finished writing a program that controls the lighting in a large office building.

The program will be installed on 200 identical control units. Each control unit has a small amount of memory and has no translator software installed on it.

The company does not want its customers to be able to read or change the program code.

Identify whether a compiler or an interpreter should be used to prepare the program for the control units, and justify your choice.

17
2 marks

Some programs written in a high-level language are partially compiled and partially interpreted. Java (console mode) is one example.

Describe what happens when a program is partially compiled and partially interpreted.

18
3 marks

A company writes one program and supplies exactly the same partially compiled file to customers who use three different types of computer.

Explain how partial compilation allows the same file to run on all three types of computer.

19
4 marks

A software company must choose between two ways of supplying a new program to its customers, who use three different operating systems.

Method A: fully compile the program separately for each of the three operating systems, and supply three different executable files.

Method B: partially compile the program once, and supply one file that is interpreted when it is run.

Explain one benefit and one drawback to the company of choosing Method B.