5.2 Language Translators
AS Level · 24 questions found
What this topic covers
Section titled “What this topic covers”- Need for assembler, compiler and interpreter
- Benefits and drawbacks of compiler vs interpreter; justify each
- Partially compiled & partially interpreted languages (e.g. Java)
- IDE features: context-sensitive prompts, dynamic syntax checks, prettyprint, single stepping, breakpoints
Past paper questions
Section titled “Past paper questions”A programmer is developing a computer program.
(a) Explain how the programmer can first use an interpreter and then a compiler to develop the computer program. 4 marks
Interpreter
Compiler
(b) The programmer releases the program as Free Software. 2 marks
Describe what is meant by Free Software.
(c) A user downloads the computer program from the internet. 1 mark
State what should be included as part of the download to make sure the program is authentic.
Show mark scheme
10(a) [4 marks]
1 mark per bullet point, max 4 marks Max 2 from each section. Interpreter: • Use an interpreter while writing/coding the program • … to test / debug the partially completed program • … because errors can be corrected and processing continue from where the execution stopped // errors can be corrected in real time // errors are identified one at a time Compiler: • Use the compiler after the program is complete • … to create an executable file so source code not seen • Use the compiler to repeatedly test the same completed section without having to re-interpret every time
10(b) [2 marks]
1 mark per bullet point, max 2 • The software is free of restrictions • The software is not necessarily free of charge • The source code comes with the program // A user can edit the source code to add functionality / suit their needs • Users can share the software with others
10(c) [1 mark]
1 mark for a correct answer • Digital Signature
Compilers and interpreters are used to translate programs written in a high‑level language into a low‑level language.
(a) State two disadvantages of using a compiler compared to an interpreter during program development. 2 marks
1
2
(b) Explain how a programmer benefits from using program libraries during program development. 3 marks
(c) A programmer is developing an Operating System (OS). 2 marks
Identify two types of software licence the programmer can use to allow other people to edit and redistribute the OS.
1
2
(d) Memory management is one key management task performed by an OS. 3 marks
Give three other key management tasks that are performed by an OS.
1
2
3
Show mark scheme
8(a) [2 marks]
1 mark per bullet point, max 2 • Large amounts of source code take time to compile • It can be slower to produce the object code than an interpreter • The code must be recompiled when it is changed • The program cannot run if there are errors • It is not possible to correct errors in real-time • One error can cause false reporting of multiple further errors • Sections of code / unfinished code cannot easily be tested
8(b) [3 marks]
1 mark per bullet point , max 3 marks • Programming time is saved as code does not have to written from scratch • Testing time is saved as code is already tested / documented • A library routine is more likely to work, as code is already tested • Library routines automatically update if they are changed / improved • The programmer can use library routines to perform complex functions / procedures that they may not be able to write themselves
8(c) [2 marks]
1 mark per bullet point , max 2 marks • Open Source (Initiative) • Free Software (Foundation)
8(d) [3 marks]
1 mark for each bullet point, max 3 marks • File management • Security management • Hardware / peripheral management // input / output management • Process management
A programmer is writing a program in a high-level language.
(a) Complete the description of compilers and interpreters by writing the missing words. 4 marks
A compiler checks all the code before attempting to translate the program. If any errors are
found, they are all reported at the same time and the program does not translate or run. If
there are no errors found, the compiler produces ______ which
can run without access to the ______ .
An interpreter translates one line of code and then runs it, before moving to the next line of
code. If the line of code has an error, the interpreter ______ and
displays the error. The programmer can correct the error
and then the interpreter continues translating from that point.
(b) The programmer needs to keep the program files secure on their computer and during electronic data transmission over the internet. The files are protected by a password. 4 marks
Complete the table by identifying one other method of keeping the files secure during electronic data transmission and one other method of keeping the files secure on the computer.
State how each method protects the data.
The methods must be different.
| Method | How the method protects the data | |
|---|---|---|
| during transmission |
______ |
|
| on the computer |
______ |
Show mark scheme
3(a) [4 marks]
1 mark for each correctly completed term • an executable file/.exe • source/program code • stops • immediately/in real-time A compiler checks all of the code before attempting to translate the program. If any errors are found, they are all reported at the same time and the program does not translate or run. If there are no errors found, the compiler produces an executable file/.exe which can run without access to the source/program code . An interpreter translates one line of code and then runs it, before moving to the next line of code. If the line of code has an error, the interpreter stops and displays the error. The programmer can correct the error immediately/in real- time and then the interpreter continues translating from that point.
3(b) [4 marks]
1 mark for method and 1 mark for corresponding description During transmission e.g. • Encryption // by example such as VPN • Jumble / encode data so it cannot be decrypted/understood without the key On computer e.g. • Firewall / proxy • Filter incoming transmissions and stop any that could be attempting unauthorised access • Anti-malware • Find and delete or quarantine any malware that could delete the data / files • Encryption • Jumble / encode data so it cannot be decrypted / understood without the key • Physical method // by example • For example, the computer storing the data cannot be accessed without the key to the room
3(c) [4 marks]
1 mark each to max 4 • A webserver stores all the data for each player • Each player is on a client computer // The player’s web browser is the client • that sends requests over the internet to the web server • the server performs the required action in the game • the server updates the data in the game • the server sends the results to the player
3(d) [3 marks]
1 mark each to max 3 e.g. • There is no / limited access to legal advice • in case action is taken against them • There are fewer networking opportunities • so they could miss out on contacts / jobs • There would be less access to training • There would be no clear laid out ethical guidelines • and / or people to discuss potential ethical problems with • possibly leading to inappropriate / unethical actions • which might lead to legal proceedings / recourse
A student uses a laptop to write a program that is saved as a text file.
(a) The laptop has utility software and an Operating System (OS).
(i) Describe the file management tasks carried out by an OS. 2 marks
(ii) Explain the need for back-up software. 2 marks
(b) The student compresses the file before it is emailed to their teacher as an attachment.
(i) Explain the benefits to the teacher of the attachment being a compressed file. 3 marks
(ii) Describe one lossless method of compressing a text file. 3 marks
(c) The student used a program library when writing their program. 3 marks
Explain the benefits to the student of using library files when writing a program.
(d) The program code is written using an Integrated Development Environment (IDE).
(i) One presentation feature found in a typical IDE is prettyprint. 2 marks
Identify and describe one other presentation feature found in a typical IDE.
Feature
Description
(ii) One debugging feature found in a typical IDE is single stepping. 2 marks
Identify and describe one other debugging feature found in a typical IDE.
Feature
Description
Show mark scheme
4(a)(i) [2 marks]
1 mark for each bullet point ( max 2 ) e.g. • Secondary storage space is divided into file allocation units • Space on secondary storage is allocated to particular files • Maintains/creates directory structures • Specifies the logical method of file storage e.g. FAT or NTFS • Provides file naming conventions • Controls user access // implements access rights //implements password protection // Makes file sharing possible • Controls access to the file by other software • Specifies tasks that can be performed on a file e.g. open, close, delete, copy, create, move, etc • Allows searching for a file
4(a)(ii) [2 marks]
1 mark for each bullet point ( max 2 ) • To allow data to be retrieved / restored when lost • To automatically make a duplicate copy of data… • …so the user does not have to remember to backup data • To make regular duplicate copies of data
4(b)(i) [3 marks]
1 mark for each bullet point ( max 3 ) e.g. • Less of the teacher’s storage space is used • ... so more student work can be stored • Transmission time is reduced • … so the teacher does not have to wait as long for it to arrive • Bandwidth usage is reduced • … so other transmissions are not adversely affected • Less data allowance is used on the teacher’s email system
4(b)(ii) [3 marks]
1 mark for each bullet point ( max 3 ) • Run-Length Encoding // RLE • Repeated sequences of the same characters are replaced by • ... a single copy of the character • ... and a count of the number of characters
4(c) [3 marks]
1 mark for each bullet point ( max 3 ) e.g. • It saves development time for the student • … by using pre-written code • There is less testing to do // the routines are more likely to work correctly • … because they have already been tested and are error-free • It results in a more robust program • Subroutines can be used that they do not have the skill to write • … which enables a more complex program to be written
4(d)(i) [2 marks]
1 mark for correct name, 1 mark for matching description • Expand/collapse code blocks… • … sections of source code that are part of the same block can be expanded to see the content or collapsed so that the overall code is seen • Auto-indentation // auto-formatting... • ... automatically indents/formats code as the user types so that the structure is clear // aids readability
4(d)(ii) [2 marks]
1 mark for correct name, 1 mark for matching description • Breakpoints … • … stops the code running on a set line to view the current status/variable contents/program flow • Report window // variable watch window … • … shows the values in variables/data structures and how they change when each line is run
A program is written in a high-level language by a team of three programmers using an Integrated Development Environment (IDE).
(a) Describe how the programmers can use the debugging features of a typical IDE during the development of the program. 4 marks
(b) The programmers created a new program library whilst developing the program. 3 marks
Describe the benefits to the programmers of creating a program library.
(c) The file containing the final program code will be sent by email for beta testing. 3 marks
Identify one security method that can be used to protect the program code from unauthorised access during email transfer.
Explain how your chosen method protects the program code.
Security method
Explanation
Show mark scheme
4(a) [4 marks]
1 mark for each bullet point ( max 4 ) e.g. • Single stepping • Run the program one line at a time • … and check the variable contents / program flow // show the effect of each line of code • Set breakpoints • … run the code up to a set line • ... and then check the status • Variable/report watch window • … view how the data changes as the program is running
4(b) [3 marks]
1 mark for each bullet point ( max 3 ) e.g. • Subroutines can be shared / reused • … between team members who are working independently • … without having to rewrite/re-test them which saves the programmers’ time • A program library provides continuity between programs/programmers • Individual programmers can contribute their specialisms to the library // Individual programmers can use the specialisms of others
4(c) [3 marks]
1 mark for the security method. 2 marks for explanation Security method: Encryption Explanation • File contents are converted to cipher text • If intercepted the data cannot be understood without the decryption key
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.
(a) The error in the program needs to be corrected. 1 mark
Identify the stage of the program development life cycle that this correction is made in.
(b) The program contains a function Lookup(). After investigation, it is found that this is the function that sometimes returns an incorrect value. 3 marks
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().
(c) To solve the error a programmer decides to create a new module. 2 marks
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.
1
2
(d) The new module referred to in part (c) introduces three new variables. 3 marks
Complete the following table by giving the appropriate data type for each.
| Variable name | Used to store | Data type |
|---|---|---|
| Name | A customer name. | |
| Index | An array index. | |
| Result | The result of the division of any two non-zero numbers. |
Show mark scheme
1(a) [1 mark]
(Corrective) Maintenance
1(b) [3 marks]
For example: • Set a breakpoint at the start of / within to stop execution at a Lookup, given statement • then use single stepping to execute one statement / instruction at a time • to display the value of variables using a watch window One mark for each: MP1 Order starting with a breakpoint and an explanation – ‘stop execution at this statement / line’ MP2 Explanation of single stepping – execute ‘line by line’ / statements MP3 Explanation of watch window – displaying the value of variable(s)
1(c) [2 marks]
Features include: MP1 Editor MP2 Auto
(syntax) complete / auto correction // identify undeclared variables(s) MP3 Prettyprint / auto-indentation / auto (structure) highlighter MP4 Dynamic syntax checking MP5 Expand / collapse code blocks MP6 Context sensitive prompts Max 2 marks
1(d) [3 marks]
One mark per row: Variable name Used to store Data type Name a customer name STRING Index an array index INTEGER the result of the division of any two non-zero Result REAL numbers
A software developer is writing a computer program.
(a) The developer uses an interpreter while writing the program code because it is easier for debugging. 2 marks
Explain one reason why it is easier to debug the program code using an interpreter instead of a compiler.
(b) The program is ready to be sold to customers. 3 marks
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.
Show mark scheme
3(a) [2 marks]
1 mark each to max 2 : The interpreter will stop when an error is found ... so the error can be corrected in real-time, and the result of changes seen immediately Only one error is displayed at a time … so fewer errors to correct simultaneously and no dependent errors
3(b) [3 marks]
1 mark each to max 3 : Program can be distributed without source code ... so it cannot be edited/stolen/plagiarised Users do not require the translator to run the program … so time is not spent retranslating by user
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.
(a) The programmer decides to use the compiler when testing the final program. 2 marks
Describe the benefits of using the compiler during testing.
(b) IDEs have many features other than built-in translators. 6 marks
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 m | must be different. Do not | give translator as one of your features. |
|---|---|---|
| Purpose | IDE feature | Description |
| for coding |
||
| for presentation |
||
| for debugging |
(c) The programmer uses program libraries when developing the program. 2 marks
Describe two benefits to the programmer of using program libraries.
1
2
Show mark scheme
8(a) [2 marks]
1 mark each to max 2 : Creates an executable file … so the code can be tested multiple times without having to recompile … so repeated testing takes less time
8(b) [6 marks]
1 mark for identification of each feature and 1 mark for matching description: e.g. For coding: IDE feature Description Context-sensitive Gives suggestions for code as the user prompts types instead of having to write/remember the code Auto -correct Corrects spelling mistakes so that user has fewer errors to correct For presentation: IDE feature Description Pretty-printing Colour code keywords so the user can identify any errors Expand/collapse (code) The user can hide code that they are not blocks currently working on For debugging: IDE feature Description Single stepping Run the code one line at a time // shows the effect of each line of code Breakpoints Stop the code running at a set point to check the flow/variable contents
8(c) [2 marks]
1 mark each to max 2 : Saves programming/testing time as code does not have to be written/re- written from scratch // code does not have to be tested Code is already tested so it is more robust/likely to work The programmer does not need to maintain the library // library routines are updated automatically Can perform complex calculations that the programmer may be unable to do Makes code more easily readable
A programmer uses both a compiler and an interpreter to translate a program written in a high-level language.
(a) Describe the advantages of using the interpreter compared to the compiler to translate the program. 4 marks
(b) State one reason why some high-level languages are partially compiled and partially interpreted. 1 mark
(c) (i) Identify two features that support the visual presentation of the code in a typical 2 marks Integrated Development Environment (IDE).
1
2
(ii) Identify two features that support the debugging of the code in a typical IDE. 2 marks
1
2
Show mark scheme
6(a) [4 marks]
1 mark for each bullet point ( max 4 ) • easier to debug the program • … because it translates line-by-line and stops when an error is found whereas the compiler translates all the program at the same time • … only reporting one error at a time • … which allows the error to be corrected in real time whereas the program would need to be corrected and recompiled • ... and the program can restart at same point when error occurred with a compiler the program needs to be re-run • The effect of any changes made by the programmer can be seen immediately with a compiler the effects can only be seen after re-running • A partially completed program can be translated / tested on its own a compiler cannot translate a partial program
6(b) [1 mark]
1 mark for each bullet point ( max 1 ) • Partially compiled programs can be used on different platforms as they are interpreted when run • Code is optimised for the CPU as machine code is generated at run time • Source code does not need recompiling so more efficient to run
6(c)(i) [2 marks]
1 mark for each bullet point ( max 2 ) • Prettyprint • Expand/collapse code blocks • Auto indentation / formatting
6(c)(ii) [2 marks]
1 mark for each bullet point (max 2 ) • Single stepping • Breakpoints • Report window • Variable expressions
A programmer uses an Integrated Development Environment (IDE) to develop a program that monitors air quality.
(a) Describe the following features of a typical IDE. 4 marks
Context‑sensitive prompts
Single stepping
(b) The program is distributed by downloading the source code and its library files from a web server.
(i) Explain the reasons for compressing the files. 2 marks
(ii) The program files are stored on a new hard disk after they have been downloaded. 3 marks
Describe the reasons why a hard disk formatter is needed for the new hard disk.
Show mark scheme
5(a) [4 marks]
1 mark for each bullet point ( max 2 for each feature). Context-sensitive prompts: • As the code is being written • …the options to complete the statement are shown Single stepping: • allows the programmer to execute the program one line at a time • …so that the effects of each statement can be seen
5(b)(i) [2 marks]
1 mark for each bullet point ( max 2 ). • To reduce the time it takes to download the program files from the web server // to upload them to the server in the first place • To reduce the amount of storage space used on the web server // user’s device
5(b)(ii) [3 marks]
1 mark for each bullet point ( max 3 ). • Disk needs to be prepared for initial use • Disk needs to be checked for errors • A new file system needs to be generated on the disk • The file allocation table needs to be set up
A software developer is working in a team writing a program for a client.
(a) The developer is writing a new program library to be used by the other team members.
(i) Define the term program library . 2 marks
(ii) Explain two benefits to the developer of choosing to create a Dynamic Link Library (DLL). 4 marks
1
2
(b) The development team needs to use a translator whilst writing the program for the client. 3 marks
Identify whether an interpreter or a compiler would be more appropriate at this stage of the program development.
Justify your choice.
Translator
Justification
(c) The development team uses an Integrated Development Environment (IDE). 4 marks
Complete the table by describing the typical features found in an IDE.
| Feature | Description |
|---|---|
| Breakpoints | ______ |
| Dynamic syntax checks | ______ |
| Context‑sensitive prompts | ______ |
| Single stepping | ______ |
(d) One section of the program being developed will convert user’s speech into commands. 3 marks
Explain how Artificial Intelligence (AI) can be used in this program.
Show mark scheme
7(a)(i) [2 marks]
1 mark each to max 2 Set of pre-written / pre-compiled / pre-tested subroutines ... which can be called in other programs ... by installing/importing the library
7(a)(ii) [4 marks]
1 mark for each bullet point. Mark in pairs; 1 mark for a benefit and 1 mark for an appropriate expansion (main) memory requirements for program is reduced ... as dynamic link library is loaded only once / when required the executable file size of the program using the DLL will be smaller ... because the executable does not contain (all) the library routines maintenance not needed to be done by the programmer ... because the DLL is separate from program no need to recompile the main program when changes are made to DLL ... because changes / improvements/ error correction to the DLL file code are done independently of the main program A single DLL file can be made available to several application programs ... Saving space in memory / easing the pressure on memory
7(b) [4 marks]
No mark for choice. 1 mark each to max 3 for justification Interpreter Allows the developer to make real-time changes … so the program can be debugged at each stage ... the effect of any changes made by the developer can be seen immediately The developer can test when incomplete … so small parts can be tested without having to test the rest of the program … if one section does not work others can still be tested To avoid dependent errors Compiler The developer can debug multiple errors simultaneously Produces an executable file … so that the developer can test the program multiple times without recompiling 1 mark each
7(c) [3 marks]
Breakpoints: Stop the code at a specific line to check the current progress / values Dynamic syntax checks: Highlight / underline / colour syntax errors as the code is entered Context-sensitive prompts: Suggest the code to add // automatically complete statements Single stepping: Run the code one line at a time so the values can be checked 1 mark each to max 3
7(d)
Uses speech recognition ... which identifies key phrases / words spoken … and matches these to a database ... and generates the most likely sentence / command / word
A programmer is developing a computer game in a high-level language to sell to the public.
(a) The programmer uses both an interpreter and a compiler at different stages of the development of the program.
(i) Explain the reasons why the programmer uses an interpreter while writing the program code. 2 marks
(ii) Explain the reasons why the programmer uses a compiler when the program has been written. 3 marks
(b) The programmer needs to publish the game under a software licence so that it can be sold to the public. 4 marks
Identify the most appropriate type of software licence for the game and justify your choice.
Licence
Justification
Show mark scheme
5(a)(i) [3 marks]
1 mark each to max 2 Programmer can test sections of the code without every part working / being written Programmer can debug in real time … so that errors can be fixed and the program continued from that point The effect of any changes made by the programmer can be seen immediately To avoid dependent errors
5(a)(ii) [4 marks]
1 mark each to max 3 The compiler produces an executable file ... so the user cannot access / edit / sell the code ... and users do not need the translator to run the game The game can be compiled for different hardware specifications ... and then used to generate more income for the programmer The program can be tested multiple times without having to retranslate each time
5(b) [5 marks]
1 mark for appropriate licence; 1 mark for each point to max 3 Commercial software licence User has to pay for the product so the programmer can gain an income Enables the program to be copyrighted ... so the user cannot legally edit the program // the programmer retains control over product … and can take legal action against people who attempt to illegally copy it /sell it on Shareware licence Enables the program to be copyrighted The user cannot legally edit the program so the developer retains control over product User can try the program for free and then pay for the full game which allows the programmer to gain an income so more people can experience it and therefore be more likely to buy it
A programmer has produced the following pseudocode to output the square root of the numbers from 1 to 10.
Line numbers are for reference only.
10 DECLARE Num : REAL
...
40 REPEAT
41 CALL DisplaySqrt(Num)
42 Num Num + 1.0
...
50 PROCEDURE DisplaySqrt(BYREF ThisNum : REAL)
51 OUTPUT ThisNum
52 ThisNum SQRT(ThisNum) // SQRT returns the square root
53 OUTPUT " has a square root of ", ThisNum
54 ENDPROCEDURE
The pseudocode is correctly converted into program code.
Function SQRT() is a library function and contains no errors.
The program code compiles without errors, but the program gives unexpected results. These are caused by a design error.
(a) Explain why the program gives unexpected results. 3 marks
(b) Explain why the compiler does not identify this error. 1 mark
(c) Describe how a typical Integrated Development Environment (IDE) could be used to identify this error. 3 marks
(d) The pseudocode is converted into program code as part of a larger program. 1 mark
During compilation, a complex statement generates an error.
The programmer does not want to delete the complex statement but wants to change the statement so that it is ignored by the compiler.
State how this may be achieved.
Show mark scheme
5(a)
One mark per point: parameter / has been passed by reference // should have been Num passed by value so when the value / is modified (in procedure ThisNum ) DisplaySqrt() the new value will be used in the loop (lines 40–43) // will be Num changed to modified value
5(b) [1 mark]
The rules of the language have not been broken // there are no syntax errors
5(c) [1 mark]
Could use an IDE to: Set a breakpoint to stop the program at a certain line / statement / point Step through the program line by line / statement by statement checking the value of / a variable using a report / watch window 'num' One mark per bullet
5(d) [6 marks]
Answers include: Change the statement into a comment Change the statement to a string representing a literal value and assign it to a variable / output it Note: max 1 mark
(a) A student uses a networked laptop computer to send an email to a colleague.
(i) Explain how a digital signature ensures the email is authentic. 2 marks
(ii) Describe how a firewall protects the data on the computer. 3 marks
(b) The student records a sound file.
(i) Explain the effect of increasing the sampling rate on the accuracy of the sound recording. 2 marks
(ii) Explain the effect of decreasing the sampling resolution on the file size of the sound recording. 2 marks
Show mark scheme
6(a)(i) [2 marks]
1 mark for each method of ensuring authenticity (max 2) : • (email) message put through hashing algorithm to produce a digest • Digest encrypted with sender’s private key (to create the digital signature) • the (digital) signature can only be decrypted with matching sender’s public key
6(a)(ii) [3 marks]
1 mark for each bullet point: • monitors incoming and outgoing packets / traffic • checks against an allow list / deny list of IP addresses // checks against a set of rules for acceptable data / ports etc. • blocks transmissions that do not meet criteria / rules // allows through is satisfies the criteria /rules
6(b)(i) [2 marks]
1 mark for each bullet point (max 2) : • improves the accuracy of the sound file • ... because (digital) waveform more closely resembles the analogue wave form • quantization errors are reduced • increases the amount of detail stored
6(b)(ii) [2 marks]
1 mark for each bullet point: • decreases the file size of the sound file • ... because fewer bits are used to store each sample
The following table shows part of the instruction set for a processor. The processor has one general purpose register, the Accumulator (ACC), and an Index Register (IX).
| Instruction | Explanation | |
|---|---|---|
| Opcode | Operand | Operand |
LDM |
#n |
Immediate addressing. Load the number n to ACC |
LDD |
<address> |
Direct addressing. Load the contents of the location at the given address to ACC |
LDX |
<address> |
Indexed addressing. Form the address from + the contents of the index register. Copy the contents of this calculated address to ACC |
LDR |
#n |
Immediate addressing. Load the number n to IX |
MOV |
<register> |
Moves the contents of the accumulator to the given register (IX) |
STO |
<address> |
Store contents of ACC at the given address |
ADD |
<address> |
Add the contents of the given address to the ACC |
ADD |
#n |
Add the denary number n to the ACC |
SUB |
#n |
Subtract the denary number n from the ACC |
INC |
<register> |
Add 1 to the contents of the register (ACC or IX) |
JMP |
<address> |
Jump to the given address |
CMP |
#n |
Compare the contents of ACC with number n |
CMI |
<address> |
Indirect addressing. The address to be used is at the given address. Compare the contents of ACC with the contents of this second address |
JPE |
<address> |
Following a compare instruction, jump to if the compare was True |
JPN |
<address> |
Following a compare instruction, jump to if the compare was False |
OUT |
Output to the screen the character whose ASCII value is stored in ACC |
|
END |
Return control to the operating system | |
| can be an absolute or a symbolic address # denotes a denary number, e.g. #123 B denotes a binary number, e.g. B01001101 |
can be an absolute or a symbolic address # denotes a denary number, e.g. #123 B denotes a binary number, e.g. B01001101 |
can be an absolute or a symbolic address # denotes a denary number, e.g. #123 B denotes a binary number, e.g. B01001101 |
(a) The current contents of main memory and selected values from the ASCII character set are given.
(i) Trace the program currently in memory using the trace table. 4 marks
Address Instruction
…
…
| Instruction address |
ACC | IX | Memory address | Output | ||||
|---|---|---|---|---|---|---|---|---|
| Instruction address |
ACC | IX | 100 | 101 | 110 | 111 | 112 | 112 |
1 |
0 |
97 |
98 |
97 |
||||
| ASCII value 49 | Character 1 | |||||||
| --- | --- | |||||||
49 |
1 |
|||||||
50 |
2 |
|||||||
51 |
3 |
|||||||
52 |
4 |
|||||||
65 |
A |
|||||||
66 |
B |
|||||||
67 |
C |
|||||||
68 |
D |

(ii) Explain the purpose of relative addressing in an assembly language program. 2 marks
| (b) The following tab | ble shows another part of the instruction set for the processor. | |
|---|---|---|
| Instruction | Instruction | Explanation |
| Opcode | Operand | Operand |
AND |
#n |
Bitwise AND operation of the contents of ACC with the operand |
AND |
Bn |
Bitwise AND operation of the contents of ACC with the binary number n |
AND |
<address> |
Bitwise AND operation of the contents of ACC with the contents of |
XOR |
#n |
Bitwise XOR operation of the contents of ACC with the operand |
XOR |
<address> |
Bitwise XOR operation of the contents of ACC with the contents of |
OR |
#n |
Bitwise OR operation of the contents of ACC with the operand |
OR |
Bn |
Bitwise OR operation of the contents of ACC with the binary number n |
OR |
<address> |
Bitwise OR operation of the contents of ACC with the contents of |
LSL |
#n |
Bits in ACC are shifted logically n places to the left. Zeros are introduced on the right-hand end |
LSR |
#n |
Bits in ACC are shifted logically n places to the right. Zeros are introduced on the left-hand end |
| can be an absolute or a symbolic address # denotes a denary number, e.g. #123 B denotes a binary number, e.g. B01001101 |
can be an absolute or a symbolic address # denotes a denary number, e.g. #123 B denotes a binary number, e.g. B01001101 |
can be an absolute or a symbolic address # denotes a denary number, e.g. #123 B denotes a binary number, e.g. B01001101 |
(i) The current contents of the ACC are:
0 0 1 1 0 1 1 0
Show the contents of the ACC after the execution of the following instruction.
AND B01001100 1 mark
(ii) The current contents of the ACC are:
1 0 0 1 0 1 0 1
Show the contents of the ACC after the execution of the following instruction.
OR B01001111 1 mark
(iii) The current contents of the ACC are:
1 0 0 1 1 1 0 1
Show the contents of the ACC after the execution of the following instruction.
LSR #2 1 mark
(c) One instruction group is data movement. 1 mark
Give the name of one other instruction group.
Show mark scheme
6(a)(i) [4 marks]
1 mark for each set of highlighted rows: Memory address Output Instruction ACC IX address 100 101 110 111 112 1 0 97 98 97 75 0 76 1 77 78 79 97 80 65 81 82 83 1 84 85 1 86 87 2 88 2 89 1 90 76 77 78 91 1 92 49 93 1 94
6(a)(ii) [2 marks]
1 mark for each bullet point: • To allow for re-locatable code • ... because all (target) addresses can be specified by the base address + offset 0000 0100
6(b)(i) [1 mark]
1101 1111
6(b)(ii) [1 mark]
0010 0111
6(c) [1 mark]
1 mark for a correct name: • input and output of data • arithmetic operations • unconditional and conditional instructions • compare instructions
A programmer uses an Integrated Development Environment (IDE) to develop a program.
(a) Draw one line from each IDE feature to its correct description.
IDE feature Description
Executes one line of the program and Context-sensitive prompt then stops
Underlines or highlights statements Dynamic syntax check that do not meet the rules of the language
Outputs the contents of variables and Breakpoint data structures
Single stepping Stops the code executing at a set line
Displays predictions of the code being Report window entered
(b) The programmer wants to allow users to edit, improve and redistribute the program. 4 marks 2 marks
Identify two different types of software licence that the programmer could use. 1
2
(c) Explain the benefits to the programmer of using program libraries. 3 marks
Show mark scheme
5(a) [4 marks]
1 mark for 1 correct line, 2 marks for 2 correct lines, 3 marks for 3 or 4 correct lines, 4 marks for all 5 correct lines IDE feature Description Context-sensitive Executes one line of the prompt program and then stops Underlines or highlights Dynamic syntax statements that do not meet check the rules of the language Outputs the contents of Breakpoint variables and data structures Stops the code executing at Single stepping a set line Displays predictions of the Report window code being entered
5(b) [2 marks]
1 mark each: Open Source Initiative Free Software Foundation
5(c) [3 marks]
1 mark per bullet point to max 3 Saves (programming/testing) time as code does not have to be written/re-written from scratch // code does not have to be tested Code is already tested so it is more robust/likely to work If there is an improvement in the library routine the program updates automatically can perform complex calculations that the programmer may be unable to do
A programmer uses language translators when writing and testing a program.
(a) Describe the operation of a compiler. 2 marks
(b) Describe the operation of an interpreter. 2 marks
(c) Explain how a programmer can make use of a typical Integrated Development Environment (IDE) when writing and testing a program. 4 marks
Writing
Testing
Show mark scheme
6(a) [2 marks]
1 mark per point to max 2 e.g. Attempts to translate the whole source code Creates a separate error report at the end of the translation process If translation successful / no errors creates an executable file
6(b) [2 marks]
1 mark per point to max 2 e.g. Reads each line then translates it and executes it Stops when an error is encountered // displays errors where it finds them
6(c) [4 marks]
1 mark per point, max 2 for writing, max 2 for testing Writing e.g. Enter code into an editor Pretty printing to identify key terms Context-sensitive prompts to help complete statements Expand and collapse code blocks Auto-complete to suggest what to type next Auto-formatting to indent code blocks Dynamic syntax checking Testing e.g. Single stepping to run the code line by line Breakpoints to stop the code at set points to check values Report window to see how variables change
(a) A programmer is testing a program using an Integrated Development Environment (IDE). 1 mark
The programmer wants the program to stop when it reaches a specific instruction or program statement in order to check the value assigned to a variable.
Give the technical term for the position at which the program stops.
(b) The following table lists some activities from the program development life cycle. 4 marks
| Complete the table by writing the life cycle stage for each activity. | |
|---|---|
| Activity | Life cycle stage |
| An identifier table is produced. | |
| Syntax errors can occur. | |
| The developer discusses the program requirements with the customer. | |
| A trace table is produced. |
(c) An identifier table includes the names of identifiers used. 2 marks
State two other pieces of information that the identifier table should contain.
1
2
(d) The pseudocode statements in the following table may contain errors. 4 marks
State the error in each case or write 'NO ERROR' if the statement contains no error.
You can assume that none of the variables referenced are of an incorrect type.
| Statement | Error |
|---|---|
Status TRUE AND FALSE |
|
IF LENGTH("Password") < "10" THEN |
|
Code LCASE("Electrical") |
|
Result IS_NUM(-27.3) |
Show mark scheme
1(b) [4 marks]
Activity Life cycle stage An identifier table is produced. Design Syntax errors can occur. Coding The developer discusses the program requirements with the Analysis customer. A trace table is produced. Testing
1(c) [2 marks]
Max 2 A description of what the identifier is used for / the purpose of the identifier The data type of the identifier The number of elements of an array // the length of a string An example data value Value of any constants used The scope of the variable (local or global)
1(d) [4 marks]
Statement Error NO ERROR Status TRUE AND FALSE IF LENGTH("Password") < "10" shouldn’t be a string // must be an "10" THEN integer Parameter must be a char // cannot be a Code string LCASE("Electrical") Alternative: LCASE should be TO_LOWER Parameter must be a string / char // Result IS_NUM(-27.3) cannot be a number
1 Initialise password to empty string at the start and return (attempted) password at the end of the function
Francis is starting his first job as a software developer for a multinational company.
(a) Francis has been advised to join a professional ethical body. 3 marks
Describe the benefits to Francis of joining a professional ethical body.
(b) Francis is shown the software he will be working on. He is unfamiliar with the Integrated Development Environment (IDE) he is required to use.
(i) Describe the ways in which Francis can act ethically in this situation. 2 marks
(ii) A typical IDE provides debugging tools to support the testing of a program. 3 marks
Identify three other tools or features found in a typical IDE to support the writing of the program.
1
2
3
(c) Francis is part of a team writing a program. He finds an error in part of the program that has already been tested. He decides not to tell anyone because he is worried about the consequences. 2 marks
Explain the reasons why Francis acted unethically in this situation.
Show mark scheme
4(a) [3 marks]
1 mark per bullet point to max 3 e.g. He has ethical guidelines to follow • … so clients/other staff know the standards being applied • … so he does not have to decide what is ethical it's written down • Clients / staff know he is reputable • … recognition of his skills / knowledge • … there may be a test / requirements for entry • They provide help and support • … for example if he needs legal advice • They run training courses • … to keep his skills up-to-date •
4(b)(i) [2 marks]
1 mark per bullet point to max 2 e.g. He can tell the manager he has not used it • … and how he will get up-to-date • He can perform his own research on how to use it • He can explain to the manager that he needs additional training • He can(ask the manager to book on a training course • He can ask for a mentor / to shadow someone • He can practice at home before starting •
4(b)(ii) [3 marks]
1 mark for each correct tool e.g. Colour coding // pretty printing • Auto-complete • Auto-correct • Context sensitive prompts • Expand and collapse code blocks •
4(c) [2 marks]
1 mark per bullet point to max 2 e.g. He didn’t act in best interest of product • … because the product might fail because he didn’t report the error • He didn’t act in best interest of client • … because if the product does not work then they have been let down • because he didn't report the error He didn’t act in the best interest of the profession • … he is letting his profession down because he didn't report the error • He didn’t act in best interest of the company • ... not correcting the error early could lead to later problems •
4(d) [4 marks]
1 mark for each correctly completed term Compilers are usually used when a high-level language program is complete. They translate all the code at the same time and then run the program. They produce executable/.exe/object code files that can be run without the source code. Interpreters translate one line of a high-level language program at a time, and then run that line of code. They are most useful while developing the programs because errors can be corrected and then the program continues from that line. Assemblers are used to translate assembly code into binary/machine code .
Francis is starting his first job as a software developer for a multinational company.
(a) Francis has been advised to join a professional ethical body. 3 marks
Describe the benefits to Francis of joining a professional ethical body.
(b) Francis is shown the software he will be working on. He is unfamiliar with the Integrated Development Environment (IDE) he is required to use.
(i) Describe the ways in which Francis can act ethically in this situation. 2 marks
(ii) A typical IDE provides debugging tools to support the testing of a program. 3 marks
Identify three other tools or features found in a typical IDE to support the writing of the program.
1
2
3
(c) Francis is part of a team writing a program. He finds an error in part of the program that has already been tested. He decides not to tell anyone because he is worried about the consequences. 2 marks
Explain the reasons why Francis acted unethically in this situation.
Show mark scheme
4(a) [3 marks]
1 mark per bullet point to max 3 e.g. He has ethical guidelines to follow • … so clients/other staff know the standards being applied • … so he does not have to decide what is ethical it's written down • Clients / staff know he is reputable • … recognition of his skills / knowledge • … there may be a test / requirements for entry • They provide help and support • … for example if he needs legal advice • They run training courses • … to keep his skills up-to-date •
4(b)(i) [2 marks]
1 mark per bullet point to max 2 e.g. He can tell the manager he has not used it • … and how he will get up-to-date • He can perform his own research on how to use it • He can explain to the manager that he needs additional training • He can(ask the manager to book on a training course • He can ask for a mentor / to shadow someone • He can practice at home before starting •
4(b)(ii) [3 marks]
1 mark for each correct tool e.g. Colour coding // pretty printing • Auto-complete • Auto-correct • Context sensitive prompts • Expand and collapse code blocks •
4(c) [2 marks]
1 mark per bullet point to max 2 e.g. He didn’t act in best interest of product • … because the product might fail because he didn’t report the error • He didn’t act in best interest of client • … because if the product does not work then they have been let down • because he didn't report the error He didn’t act in the best interest of the profession • … he is letting his profession down because he didn't report the error • He didn’t act in best interest of the company • ... not correcting the error early could lead to later problems •
4(d) [4 marks]
1 mark for each correctly completed term Compilers are usually used when a high-level language program is complete. They translate all the code at the same time and then run the program. They produce executable/.exe/object code files that can be run without the source code. Interpreters translate one line of a high-level language program at a time, and then run that line of code. They are most useful while developing the programs because errors can be corrected and then the program continues from that line. Assemblers are used to translate assembly code into binary/machine code .
Jennifer is writing a computer program for her A Level homework.
(a) Jennifer uses a program library to help her write her computer program. 2 marks
Describe how a program library can be used while writing a computer program.
(b) Jennifer uses an Integrated Development Environment (IDE) to write her computer program.
(i) The IDE allows Jennifer to use both an interpreter and a compiler while creating her computer program. 4 marks
Describe the ways in which Jennifer can use both a compiler and an interpreter while developing the program.
(ii) Identify two debugging tools that a typical IDE can provide. 2 marks
1
2
Show mark scheme
7(a) [2 marks]
1 mark per bullet point to max 2 Program libraries store pre-written functions and routines • The program library can be referenced/imported • the functions/routines can be called in her own program •
7(b)(i) [2 marks]
1 mark per bullet point to max 4; max 3 from each section Interpreter: Use an interpreter while writing the program • … to test/debug the partially completed program • … because errors can be corrected and processing continue from where • the execution stopped // errors can be corrected in real time // errors are identified one at a time Compiler: Use the compiler after the program is complete • … to create an executable file • Use the compiler to repeatedly test the same (completed) section • … without having to re-interpret every time // compiler not needed at run- • time
7(b)(ii)
1 mark per correct tool to max 2 e.g. Breakpoints • Single stepping • Report windows •
(a) Draw one line to connect each Operating System (OS) term to the most appropriate description about it. 5 marks
OS term Description
Multi-tasking
Paging
Interrupt handling
Scheduling
Virtual memory
Using secondary storage to simulate additional main memory
Managing the processes running on the CPU
Managing the execution of many programs that appear to run at the same time
Locating non-contiguous blocks of data and relocating them
Transferring control to another routine when a service is required
Reading/writing same-size blocks of data from/to secondary storage when required
(b) Explain how an interpreter executes a program without producing a complete translated version of it. 4 marks
Show mark scheme
3(a) [5 marks]
One mark for each correct line from Operating System Term to Description Managing the execution of many programs time that appear to run at the same
3(b) [4 marks]
One mark for each correct statement (Max 4) An interpreter examines source code one statement at a time • Check each statement for errors • …If no error is found the statement is executed • …If an error is found this is reported and the interpreter halts • Interpretation is repeated for every iteration in repeated sections of • code/in loops Interpretation has to be repeated every time the program is run •
(a) Draw one line to connect each Operating System (OS) term to the most appropriate description about it. 5 marks
OS term Description
Multi-tasking
Paging
Interrupt handling
Scheduling
Virtual memory
Using secondary storage to simulate additional main memory
Managing the processes running on the CPU
Managing the execution of many programs that appear to run at the same time
Locating non-contiguous blocks of data and relocating them
Transferring control to another routine when a service is required
Reading/writing same-size blocks of data from/to secondary storage when required
(b) Explain how an interpreter executes a program without producing a complete translated version of it. 4 marks
Show mark scheme
3(a) [5 marks]
One mark for each correct line from Operating System Term to Description Managing the execution of many programs time that appear to run at the same
3(b) [4 marks]
One mark for each correct statement (Max 4) An interpreter examines source code one statement at a time • Check each statement for errors • …If no error is found the statement is executed • …If an error is found this is reported and the interpreter halts • Interpretation is repeated for every iteration in repeated sections of • code/in loops Interpretation has to be repeated every time the program is run •
(a) Draw one line to connect each Operating System (OS) term to the most appropriate description about it. 5 marks
OS term Description
Multi-tasking
Paging
Interrupt handling
Scheduling
Virtual memory
Using secondary storage to simulate additional main memory
Managing the processes running on the CPU
Managing the execution of many programs that appear to run at the same time
Locating non-contiguous blocks of data and relocating them
Transferring control to another routine when a service is required
Reading/writing same-size blocks of data from/to secondary storage when required
(b) Explain how an interpreter executes a program without producing a complete translated version of it. 4 marks
Show mark scheme
3(a) [5 marks]
One mark for each correct line from Operating System Term to Description Managing the execution of many programs time that appear to run at the same
3(b) [4 marks]
One mark for each correct statement (Max 4) An interpreter examines source code one statement at a time • Check each statement for errors • …If no error is found the statement is executed • …If an error is found this is reported and the interpreter halts • Interpretation is repeated for every iteration in repeated sections of • code/in loops Interpretation has to be repeated every time the program is run •