You are on page 1of 8

Chapter 8: System software: Answers to

coursebook questions and to Worksheet


questions
Syllabus sections covered: 5.1 and 5.2

From the coursebook


Task 8.01
The task refers to individual points made in this section of the coursebook but learners might wish to expand the
scope, for instance to include backup, which could be entered under one of three categories. Some decisions are
subjective so there are not necessarily right and wrong answers. Learners should be able to see links between
bullet points. For example, access control mechanisms can be linked to ensuring data privacy, resolution of
conflicts when processes use the same resource can be linked to memory usage optimisation and to control of
usage of devices by processes. Hopefully this task will encourage learners to read a little more thoroughly and
gain better understanding.

Question 8.01
It could be argued that all tasks are assisting the user, but aspects that are more difficult to categorise are security
management and error detection and recovery, which have user-oriented aspects, and others that are just about
keeping the system running. Probably the best approach for choosing tasks that are intended to assist the user is
to ask which ones involve direct action by the user. This leads definitely to the user–system interface and file
management, and possibly to security management and error detection and recovery. For the latter two, the user
tends to have concerns about data privacy that require specific measures to be taken. The user might have to
make decisions about recovery from error.

Task 8.02
This is self-explanatory.

Question 8.02
This is self-explanatory.

Task 8.03
This is self-explanatory.

© Cambridge University Press 2019


Exam-style Questions
1 a i Graphical user interface (GUI allowed) (1), command line (console mode allowed) (1).
ii Mouse (1), pointer (1), touch screen (1), keyboard (1). (max 2)
b i Straight from the coursebook answers (1 mark for each task and 1 each for an explanation, up to a
maximum of 6). The explanation could be just an action, for example, device management explained
as installing device driver software.
2 a i Hard disk formatter and checker, hard disk defragmenter. (1 mark each, max 2)
ii Again answers can take information directly from the coursebook but they must identify a need (1 for
each with the possibility of 2 for one program if two different reasons are provided) and an
explanation of what the program does (1 for each sensible individual point made). (max 5)
iii Backup software, virus checker, file compression software. (1 each, max 2)
b i 1 mark each for any of the following. (max 3)
Written by professional programmers (1), efficient code (1), already been used by others (1), unlikely
to be errors (1). No marks for ‘quicker’ or ‘easier’.
ii Anything sensible, just a name required. (1 each, max 2)
3 a Assembler for assembly language, other two for a high-level language. (1)
b i Interpreter executes line by line, compiler does not execute (1), compiler produces object code,
interpreter does not produce object code (1), interpreter needs data to be present, compiler
does not (1).
ii There are some standard statements that can be made. such as an ‘interpreter is better for debugging
because syntax errors can be resolved line by line’. Object code from a compiler when linked and
loaded executes faster than would happen if the program was interpreted. Source code must be
present when an code from a compiler is run. One less obvious statement is that source code is
unlikely to contain a virus but object code could possibly do so. A good answer tries to discuss
advantages and disadvantages with reference to a programmer, a software developer providing a
product or a user of such software. There are different ways that the marks can be gained, up to a
maximum of 4 marks.
iii 1 mark each for any of the following. (max 1)
Uses both a compiler and an interpreter (1), produces Java bytecode (1) which is run on a Java Virtual
Machine (1).
4 a Prettyprinting, 1 mark each for any of the following. (max 2)
 Automatically colour-codes (1) keywords (1), built-in function calls (1), comments (1), strings (1) the
identifier in a function header (1), automatic indentation (1).
Context-sensitive prompt, 1 mark each for any of the following. (max 2)
 Displays hints/choice (1) of keywords (1), available identifiers (1) at the current insertion point of the
program code (1).
Dynamic syntax check, 1 mark each for any of the following. (max 2)
 When a line has been typed (1), editor performs syntax check (1), and alerts the programmer to
errors (1). Note: zero marks if no reference to when something has been typed.
Debugging, 1 mark each for any of the following. (max 2)
 The process of finding the errors (1) when a program has failed (1) and correcting the code (1).

© Cambridge University Press 2019


b 1 mark each for any of the following. (max 4)
The program can then be stepped through one instruction at a time (1), possible to select a breakpoint
(1), when the program starts running it will stop when it reaches the breakpoint (1), values of variables
can be checked (1), the state of the program can be examined (1).
5 This is Question 10 in 9608 Paper 12 November 2015. At the time of writing the published mark scheme is
available on the Cambridge International School Support Hub (requires registration). The Examiners Report
for the November 2015 series is also available there and this may contain comments specific to this question.
The following are what the author of this chapter in the Teacher Resource would suggest as reasonable
answers with alternatives suggested where appropriate. Where a suggested answer includes bullet points,
each bullet point would be worth one mark up to the maximum mark allocation for the question.
a The first stage of formatting is to configure the disk by creating the sector structure on the disk. The aim
then is to allow the file system provided by the operating system on the computer user to interact with
the storage structure on the disk. This requires a file system for the disk to be set up that is used by the
disk controller software. There may be an option for the formatting to divide the disk into partitions. The
creation of a boot sector on the disk is another option. Finally, the formatter might carry out a check for
bad sectors.
b The best options are:
 A defragmenter, which aims to achieve contiguous storage of the data in an individual file wherever
possible. During normal use, file content changes due to deletion, insertion or editing. The content
can be forced to be stored in many different sectors. This causes extra disk head movement when the
file is being used, which degrades performance.
 A contents analysis program coupled with a disk repair capability. Parts of the disk surface can
become unusable because of physical wear and tear. Bad sectors can be identified and labelled as
unusable. The program may be able to recover some of the file content when other parts of the file
are no longer accessible.
 A disk cleaner will identify and remove redundant files. This is good practice when a disk
is getting full.
 Compression software to improve storage capacity
 Anti-malware software, which should be used routinely but will be particularly necessary if the cause
of the deterioration in performance is the presence of a virus.
Cambridge International AS & A Level Computer Science 9608 paper 12 Q10 November 2015
6 This is Question 8 in 9608 Paper 12 November 2016. At the time of writing the published mark scheme is
available on the Cambridge International School Support Hub (requires registration). The Examiners Report
for the November 2016 series is also available there and this may contain comments specific to this question.
The following are what the author of this chapter in the Teacher Resource would suggest as reasonable
answers with alternatives suggested where appropriate. Where a suggested answer includes bullet points,
each bullet point would be worth one mark up to the maximum mark allocation for the question.
a There are three categories of benefits:
 The time taken to write a routine. This does not make sense if someone else has already written a
routine that provides the same functionality.
 The task is beyond the programmer. The programmer knows how to use value provided by a routine
but does not know how that value is calculated. An example would be a routine providing a statistic
derived from a collection of data.
 A library function will be reliable. It will have been written by an expert and will have been thoroughly
tested. Its extensive previous use will have identified any residual faults in the software.

© Cambridge University Press 2019


b i Some of the advantages described in part a would still apply but they should not be included here.
The following are possible answers:
 DLL routines are provided for use by the operating system. They are only loaded into memory
when required. The executable file is smaller because not all of the routines it uses are contained
in the file. This saves on storage space and on memory usage when the program is running.
 A DLL routine can be used simultaneously by more than one program. This gives rise to the same
advantages as described above.
 Changes can be made to a DLL routine. This can be done independently of any program using the
routine. There is no need for re-compilation of any programs using the routine.
ii One option is to state that the executable file is no longer self-contained because all of the routines
that are required for the execution of the program are not included. This could limit its use on
different systems.
The other options all relate to a circumstance when the executable is expecting the appropriate DLL
routine to be available. Reasons for problems include:
 The linking software is unavailable at run time so the program will not run.
 The DLL routine has been changed so an incorrect result might be produced.
 The DLL routine is not available so the program will not run.
 The DLL routine might have been infected by a virus so the program may not function correctly but
also the system could get infected.
Cambridge International AS & A Level Computer Science 9608 paper 12 Q8 November 2016

Worksheet 8.1: for testing basic understanding


1 a  The capability to store, edit, copy or delete a file.
 The ability to identify a specific file on a specific storage medium.
 Rules for naming files that allow the user to choose sensible ones and also allow the type of
file to be defined.
 The facility for files to be organised in directories or folders.
 Options for how the files are ordered when a list of the files is requested.
 Rules for defining the pathname for a file to identify where it is stored.
 Options for regulating file usage via permissions, such as read only, that may be applied to individual
files or to directories.
 Information about files, such as the date of creation or when it was last modified.
 The facility for compressing a file.
 The facility for encrypting a file.
b  Files need to be copied for back-up or for moving to a portable storage device for use on a
different system.
 Organisation into directories or folders with sensible names makes finding a file much easier.

© Cambridge University Press 2019


 A security concern is the reason for setting permissions or encrypting a file. In a special case, the user
might have created a file vital for a specific use. Accidental deletion would be a disaster, so the user
sets a suitable permission on the file.
 Having the date of creation or modification helps when a new version of a file is created by modifying
a previous version; in particular, when the latest modification proves unsuccessful and reversion to a
previous version is necessary.
 File compression is needed when storage capacity is limited or when a file has to be sent elsewhere.
 Some of the facilities help the system to identify correct or incorrect usage of files.
c It is likely that discussion will relate to the Windows operating system and its Explore feature. There are
two main sets of facilities, and both are provided in a menu obtained by a right-click. (Some of the
facilities are also accessed by the use of the CTRL key in combination with a different key.) The first set of
facilities includes delete, copy, paste and so on. The second set of facilities are found via the properties
menu item, which leads to a window that allows a number of options, in particular those relating to
setting access permissions.
d This second operating system should be one that uses a command line interface. DOS or UNIX would be
obvious choices. Some examples of UNIX commands used with files and directories are:
 rm
 rmdir
 mv
 cp
 cd
 chmod
 ls
Similar commands are available in DOS.
2a, b  Disk formatting: prepares a disk for use by setting up the file system on the disk.
 Partition creation: creates logical parts of one physical disk; each partition is identified by a letter (for
example, d:).
 Disk analysis: identifies problems that can then be resolved.
 Defragmentation: reorganises the file storage on the disk with the aim of having each file in
contiguous sectors.
 Disk repair: identifies faulty parts of the disk and ensures that faulty sectors are no longer used.
 Disk recovery: recovers as much of the content of files stored on a damaged disk as possible.
c  Some of the programs should be run on a regular basis because normal usage of a disk eventually
causes problems. This applies particularly when the disk starts to get full.
 Disk formatting would be carried out when a disk is first used, or possibly when a disk has been used
but the contents are no longer of use and can be overwritten.
 Creation of partitions is carried out to better organise the system. A supplier might partition a disk
when a product is initially sold. Alternatively, a user might choose to use partitioning; for example,
they might create a new partition to run a different operating system.
 Disk recovery is attempted only when a serious problem such as a disk crash has occurred.

© Cambridge University Press 2019


d The formatting of a disk or partition is irreversible. The user must be careful not to format the wrong disk.
Defragmentation requires some free space on a disk. Allowing a disk to become full can cause problems
that are only solved by removing some of the content.
3 a There are a large numbers of options. The question should be answered by considering the libraries
available for the programming language you have chosen. The answers shown here assume Python is the
language. A simple example would be:
sum(a,b,c)
max(a,b,c)
pow(x,y,z)
b The Python standard library. Simple operations on numerical values.
c The sum function and the max function require each item to be identified by the parameter list. One
value for the sum of the arguments or for the largest value is created by the function use.
The pow function normally takes two numerical values as arguments and creates the value for xy. If the
third parameter is present, it is a value to be used as a modulo for the calculation of the power. This is an
example of a function with several associated rules.
4 a Disk defragmenter A
b Backup program A
c Backup recovery program B
d Disk formatter B
e Virus checker A
f Disk content analysis program B
Some of these are less straightforward than others. A disk formatter is used when a disk is first installed in a
system but afterwards is only likely to be used when there has been a problem. If a system has a problem
because it has been infected by a virus, then a virus checker will be used (the virus checker program should be
running routinely all the time the system is being used).
5 a The developer might initially choose an interpreter because this identifies errors step-by-step and,
therefore, normally makes debugging easier. However, a line of code can appear to be error-free but will
in fact cause a problem in a different part of the program.
When the developer has a product ready for distribution or for sale, a compiler might be chosen. This is
because the source code can remain in the developer’s possession.
b Executable code produced by a compiler executes faster.
Provided that the code has been created for the processor being used, the executable code can be run
without the compiler being installed on the system.
Executable code might contain hidden malware.
An interpreter must be installed if no executable code has been supplied.
6 A False, B True, C True, D False, E False
Learners need to remember the difference between how an interpreter works and how a compiler works.
Unfortunately, their names do not provide any clue. There is a need to distinguish between what happens
during program development when the programmer is checking for errors as compared to when the program
has been checked and is being executed by a user. The answer to the last option on the list is not immediately
obvious. It is important to understand that a large program can have many sections of code that are not used
every time a program is run. A compiler will check all of the source code for errors during compilation but an
interpreter will only check the code that is used in the particular execution of the program.

© Cambridge University Press 2019


7 A programmer writes a program in Java. This C is made available to a Java D. If there are no errors this
produces A. When a user wishes to run the program the computer to be used to run the program must have a
B installed. This is an E which executes the program.

Worksheet 8.2: more challenging questions


1 a  Source code is a text file containing a program written in a high-level language.
 Intermediate code is produced by either a compiler or an interpreter if a line of source code has no
syntax error. An interpreter uses the intermediate code immediately for execution.
 Machine code consists of a sequence of instructions in a binary code that can be understood and
acted upon by the processor for which it is intended.
 Object code is the end-product of compilation.
 Executable code is produced by software called a linker and is ready for loading into memory
prior to execution.
 Byte code is produced by a Java compiler and can be interpreted by a Java Virtual Machine when
execution is required.
b Different sources will make different statements concerning machine code, object code and executable code.
It is probably most accurate to say that object code and executable code will contain machine code.
c Source code is the original code, which can be converted to intermediate code or to byte code.
Intermediate code is used by a compiler to produce object code, which contains machine code. Object
code can be converted to executable code. Often several individual object codes are converted into one
executable code.
2 a
A
A B
A B C
A B C D
A B D
A B E D
B E D
F B E F D
F E F D
F G E F G D G
F G E F G D G

b File H cannot be stored because it needs six sectors. Ideally the user should see a message that the file
was too big to be stored, rather than a message that the disk was full.
c The total storage capacity is 21 MiB.
Total stored = D + E + F + G = 14 MiB, which is 66.67 % of 21 MiB.

© Cambridge University Press 2019


3 There are many different possible approaches. The design presented here uses structured English and would
be suitable for a program using global variables throughout. It is suitable for expanding as a pseudocode
design or as a flowchart. It can form a basis for discussion.
The design defines a main program and three procedures.
 Main program:
If it is the first time the program is used call the initialisation procedure.
Input filename.
Input file size.
Input action to be taken.
If action is add, call the add file procedure.
If action is delete, call the delete file procedure.
 Initialisation procedure:
Input sector size.
Input disk capacity.
Calculate the number of sectors as disk capacity divided by sector size.
For each sector associate the name ‘empty’.
Output a message to say that the disk is ready for storing files then exit the program.
 Add file procedure:
Calculate the number of sectors needed for the file as file size divided by sector size, including one sector
available at the end for partial filling.
Loop through the sectors starting from sector 0, counting the number labelled as ‘empty’ and checking
the total found against the number needed for the file.
 If the number labelled as ‘empty’ is less than the file size, output an error message and exit the program.
 If the number labelled as ‘empty’ is greater than or equal to the file size, loop through the following until the
whole file has been stored using the number of sectors needed for the file to control the loop termination:
If the file size remaining is zero, exit the program.
Remove a portion of the file from the beginning.
Calculate file size remaining by subtracting 1 from the previous value.
Loop through the sectors until one is found that has the label ‘empty’ then copy the removed file portion
to the sector and label the sector with the filename, then exit from this inner loop.
 Delete file procedure:
Input filename.
Search through sectors one by one.
If filename found change sector name to ‘empty’.

© Cambridge University Press 2019

You might also like