Cores CISC and Methodologies
Cores CISC and Methodologies
INSTRUCTIONS TO CANDIDATES
• Write your name, centre number and candidate number in the boxes above. Please write clearly and in capital letters.
• Use black ink. HB pencil may be used for graphs and diagrams only.
• Answer all the questions, unless your teacher tells you otherwise.
• Read each question carefully. Make sure you know what you have to do before starting your answer.
• Where space is provided below the question, please write your answer there.
• You may use additional paper, or a specific Answer sheet if one is provided, but you must clearly show your candidate
number, centre number and question number(s).
[2]
(ii) Give the identifiers of all the variables used in this program.
[1]
The main program initialises a new instance of Board. The programmer is considering declaring this as
a global variable or as a local variable and then passing this into the subroutines that control the
game.
01 total = 1
02 smallest = 9999
03 largest = -1
04 for x = 0 to 21
05 dataArray[x] = input("Enter a number")
06 total = total + dataArray[x]
07 if dataArray[x] < largest then
08 largest = dataArray[x]
09 endif
10 if dataArray[x] < smallest then
11 smallest = dataArray[x]
12 endif
13 next x
[1]
(ii) Give one benefit and one drawback of declaring dataArray as a local variable in the main
program.
Benefit
Drawback
[2]
2 [2]
This will partially sort an array of numbers called numbers that is passed as a parameter.
(i) Explain why the procedure bubbleSort accepts the array numbers by reference and not by
value.
[3]
(ii) The programmer has used a for loop on line 3 in the procedure bubbleSort. A for loop is a
count controlled loop.
[1]
[3]
(iv) The procedure bubbleSort will only partially sort the array numbers into order.
Describe what the programmer would need to add to the algorithm to enable it to fully sort the
numbers into order.
[2]
State why the integer values are stored in an array instead of separate variables.
[1]
The pseudocode function useWords() here uses the global array words. The number of words in the
array words is passed as a parameter.
[2]
[2]
(iii) Rewrite the function useWords() to use a while loop instead of a for loop.
The function header and close have been written for you.
endfunction
[4]
7 Kylie buys used games consoles and then sells them to make a profit. She sells her products in
multiples of £5 such as £30, £55 and £95. Kylie only accepts £50, £20, £10 and £5 notes from her
customers.
Kylie has written an algorithm which will calculate the amount of change needed by stating how many
£20, £10 and £5 notes are needed.
The program should output the minimum number of notes required. For example if £35 change is
required then it should output 1 x £20 and 1 x £10 and 1 x £5.
[2]
Table 5
[5]
01 procedure bubbleSort(numbers)
02 do
03 sorted = true
04 for count = 0 to numbers.length -2
05 if numbers[count] > numbers[count+1] then
06 temp = numbers[count+1]
07 numbers[count+1] = numbers[count]
08 numbers[count] = temp
09 sorted = false
10 endif
11 next count
12 until sorted == true
13 endprocedure
(ii) Identify the name of the parameter used in the procedure bubbleSort.
[1]
(iii) Describe the purpose of the temp variable in the procedure bubbleSort.
[2]
(iv) Describe the purpose of the sorted variable in the procedure bubbleSort.
[2]
The numbers at the side of each row and column tells the player how many of the boxes are coloured
in consecutively. Where a row has two or more numbers, there must be a white square between the
coloured squares.
In this example:
• the first column has 1 1, this means there must be two single coloured boxes in this column.
There must be at least 1 white box between them.
• the first row has 2, this means there must be two consecutively coloured boxes in the row.
Juan is creating a program that will store a series of Nonograms for a user to play. The game will
randomly select a puzzle and display the blank grid with the numbers for each row and column to the
user.
The user plays the game by selecting a box to change its colour. If the box is white it will change to
black and if it is black it will change to white. The user can choose to check the answer at any point,
and the game will compare the grid to the answers and tell the user if they have got it correct or not.
(i) Complete the structure diagram by adding another layer for New game, Play game and Check
answer.
[2]
(iii) Identify one input, one process and one output required for the game.
Input
Process
Output
[3]
(i) Juan creates a function, countRow(), to count the number of coloured boxes in one row and
return the number of consecutive coloured boxes in that row. If there is more than one set of
coloured boxes in the row, these are joined together and the string is returned. For example, in the
following grid countRow for row 0 will return "2" as a string, and countRow for row 2 will return "1
1" as a string. If there are no 1s in a row, then "0" is returned as a string.
[2]
(iii) Describe the purpose of branching and iteration in the function countRow.
[3]
(iv) The procedure displayRowAnswer() takes puzzle as a parameter and outputs the value in
each box. Each box in a row is separated by a space. At the end of each row there are two spaces
and (by calling the function countRow from part (i)) the clue values for that row.
Would output:
[6]
(v) The function checkWon() takes answerGrid and puzzle as parameters and compares each
element in the grids. If they are identical, it returns true, otherwise returns false.
01 function checkWon(puzzle)
02 for row = 0 to 4
03 for column = 0 to 4
04 if puzzle[row, column] == answerGrid[row, column] then
05 return false
06 endif
07 next column
08 next column
State the line number of each error and give the corrected line.
Error 1 correction
Error 2 correction
Error 3 correction
[3]
(c) * Juan passed the two arrays as parameters, but he did consider making them globally accessible.
Compare the use of global and local variables and data structures in this program. Include the use of
parameters and program efficiency in your answer.
Describe how the program could be written to automatically generate a new Nonogram.
[4]
11(a A printer buffer is a storage area that holds the data, known as jobs, that are to be printed by a printer.
)
A simulation of the printer buffer uses a queue data structure to store jobs that are waiting to be
printed. The queue is not circular.
The printer buffer is represented as a zero-indexed 1D array with the identifier buffer.
Fig. 2 shows the current contents of the queue buffer and its pointers.
queueHead
queueTail
[2]
The procedure enqueue adds the job passed as a parameter to the queue.
Show the final contents of the queue and pointer values after the following instructions have been run
on the queue buffer shown in Fig. 2.
dequeue()
dequeue()
enqueue(job-128)
dequeue()
enqueue(job-129)
[5]
(i) The function dequeue returns null if the array is empty, and the contents of the next element if
not empty. The queue is not circular.
Write an algorithm, using pseudocode or program code, for the function dequeue().
[5]
(ii) The function enqueue returns -1 if there is no space at the end of the queue to add data, and
returns 1 if the parameter was added to buffer. The array buffer contains a maximum of 100
elements.
Write an algorithm, using pseudocode or program code, for the function enqueue().
(iii) In the main program of the simulation the user is asked whether they want to add an item to the
queue or remove an item.
If they choose to add an item they have to input the job name, and the function enqueue is called.
If they choose to remove an item, the function dequeue is called and the job name is output.
Appropriate messages are output if either action cannot be run because the queue is either empty
or full.
Write, using pseudocode or program code, an algorithm for the main program of the simulation.
Describe how the functions enqueue and dequeue will need to be changed to allow buffer to work
as a circular queue.
[3]
(e) Some print jobs can have different priorities. The higher the priority the sooner the job needs to be
printed.
Describe how the program could be changed to deal with different priorities.
[3]
Part of the site is shown below. The words ‘Book tickets’ link to the page ‘bookings.html’.
Upcoming productions:
1. Macbeth
2. Blood Brothers
3. An Inspector Calls
Book tickets
The theatre manager wants some text on the website to display “Midweek Special – tickets £15
tonight” on Tuesdays and Wednesdays, and “Tickets £20 tonight” on all other nights.
The website coders will use a div tag with the id ‘prices’ to do this. The Javascript code to change
the contents of the div tag has been started below. The variable dayCode holds a number
representing the current day of the week (0 for Sunday, 1 for Monday, 2 for Tuesday and so on).
Complete the Javascript code below so the correct message is displayed in a div tag with the id
‘prices’.
= priceText;
[4]
Describe how parallel processing would increase the performance of this computer system.
[3]
14(a Beryl has to write a program that explains patterns in crystals, using the following information.
)
All the patterns in crystals have two lengths, x and y, and an angle A.
(i) Rewrite the IF statement in line 05 so that it allows for an error of up to 2° in the measurement of A.
[2]
(ii) Rewrite the IF statement in line 06 so that the condition is true if the difference between x and y is
less than 10% of the length of x.
[4]
[2]
[1]
An important design consideration is whether OCRSystems use a CISC processor type or a RISC
processor type.
[2]
16 CPUs can be designed to take a Complex Instruction Set Computer (CISC) or a Reduced Instruction
Set Computer (RISC) approach.
[2]
Features
The new OCR Smart Watch:
1. Uses the CB2 RISC processor for long battery life
2. Stores up to 20hrs of music
3. Tracks fitness
Download The Factsheet
(i) Write the HTML to produce the extract from the webpage above. You can assume it will be placed
within the <body> tags of a pre-existing page. You do not need to specify the font.
[5]
(ii) Explain what happens when a search engine indexes the page. You do not need to discuss
ranking.
(iii) Explain why using a RISC processor rather than a CISC processor is likely to result in increased
battery life.
[3]
Describe one advantage to the company of using a RISC processor, rather than a CISC processor.
[2]
Method Description
Extreme programming ........................................................................................
........................................................................................
........................................................................................
Waterfall lifecycle ........................................................................................
........................................................................................
........................................................................................
Spiral model ........................................................................................
........................................................................................
........................................................................................
[6]
20 Taylor is designing a program for a client who would like to simulate earthquakes on major cities
around the world in 3D. The client would like to be able to view any stage of an earthquake such as:
Taylor is deciding which software development methodology to use to write the program. The client
(i) Describe the difference between the spiral model and the waterfall model.
[4]
(ii) Give two reasons why the waterfall model is not suitable for Taylor.
[2]
Name
Description
[2]
In order to keep up to date with the latest virus threats, the company is continually updating their
software.
The programmers use an Extreme Programming approach when developing the updates.
Explain what is meant by Extreme Programming and why it is a suitable approach in this case.
[4]
22
A procedure takes as input a number between 1 and 100. It calculates and outputs the square of each
number starting from 1, to the number input. The square of a number is the result of multiplying a
number by itself.
[3]
(ii) For each type of test given in the table, identify two examples of test data that can be used to test
the program.
[3]
3 [3]
(ii) Justify why the waterfall lifecycle is suited to the development of the operating system.
[2]
(iii) Give one disadvantage of using the waterfall lifecycle to develop the operating system.
[1]
* The software team that produces De-Duplicator decides to make a new version that can detect
duplicated images the previous version could not. The software team must decide which methodology
they will use for the project. Some members of the team suggest extreme programming whilst others
would prefer to use the waterfall lifecycle.
Discuss the two methodologies and justify which you would recommend.
[12]
ii 1 mark for all variables: 1 Must have all three for the mark to be
abc awarded.
Examiner’s Comments
Total 3
# 2023 Section B
class Treasure:
def getValue(self):
return self.__value
def getLevel(self):
return self.__level
class Board():
def __init__(self):
self.__grid = [[Treasure(-1,"") for
_ in range(20)] for _ in range(10)]
Total 9
Total 5
Exemplar 1
Total 9
Can refer to all 50 only using one The concept of having a single
identifier // all values can be indexable identifier seemed to be
indexed in one array poorly understood with few candidates
The numbers can be passed as a gaining the mark. While many
single parameter candidates understood that an array
Does not need 50 variables to be can be iterated through, they did not
declared/passed link this to the fact that elements in an
array are indexable. Similarly,
unqualified points such as ‘an array is
easier to sort’ were not given marks for
the same reason.
Total 1
Off-by-One errors
There were many off-by-one errors
observed, e.g. while count <=
numberOfWords rather than while
count < numberOfWords.
Total 8
Total 2
Total 5
Total 6
e.g.
Clicking a box
Process:
Output:
e.g.
procedure
displayRowAnswer(puzzle)
for i = 0 To 4
for j = 0 To 4
print(puzzle[i, j] + "
")
next j
print (" " + countRow
(puzzle, i))
next i
endprocedure
v 1 mark for clearly identifying each error 3 AO2.1 Do not award marks for line numbers
and giving the correction. (3) alone without stating the error.
c Mark Band 3 – High level (7-9 marks) 9 AO1.1 AO1: Knowledge and Understanding
The candidate demonstrates a (2) Indicative content
thorough knowledge and AO1.2 Local variables:
understanding of local and global (2)
variables; the material is generally AO2.1 Scope within the module defined
accurate and detailed. (2) within
The candidate is able to apply their AO3.3 Cannot access externally unless
knowledge and understanding directly (3) passed as parameter, or returned
and consistently to the context from function
provided. When module is exited, memory of
Evidence/examples will be explicitly variable is freed
relevant to the explanation.
The candidate is able to weigh up the Global variables:
use of both local and global variables
which results in a supported and Scope within the entire program
realistic judgment as to whether it is Can access from anywhere
possible to use them in this context. Retained in memory permanently
There is a well-developed line of
reasoning which is clear and logically ByRef Points to location of variable
structured. The information presented ByVal Sends the value
is relevant and substantiated.
AO2: Application
Mark Band 2 – Mid level (4-6 marks)
The candidate demonstrates If global the arrays can be
reasonable knoledge and accessed from all modules by direct
understanding of local and global reference
variables; the material is generally If local to the main, the arrays will
accurate but at times underdeveloped. need to be passed as parameters
The candidate is able to apply their byreference
knowledge and understanding directly Can send ByVal – but not always
to the context provided although one or possible with arrays in some
two opportunities are missed. languages
Evidence/examples are for the most Modules are self contained and
part implicitly relevant to the then can be reused in other
explanation. programs he wants to create
The candidate makes a reasonable without needing to take the global
attempt to come to a conclusion variables with them
showing some recognition of
influencing factors that would AO3: Evaluation
determine whether it is possible to use e.g.
local and global variables in this
context. +ve Local = memory efficient
There is a line of reasoning presented +ve Global = easier programming,
with some structure. The information simpler to follow, easier to debug
presented is in the most part relevant -ve Global = memory inefficient, not
0 marks
No attempt to answer the question or
response is not worthy of credit.
Total 40
e.g.
function dequeue()
if queueHead > queueTail
then
return null
else
queueHead = queueHead +
1
return
buffer[queueHead-1]
endif
endfunction
e.g.
function enqueue(newJob)
if queueTail == 99 then
return -1
else
queueTail = queueTail +
1
buffer[queueTail] =
newJob
return 1
endif
endfunction
e.g.
main()
returnValue = enqueue(jobname)
if returnValue == -1 then
print("Queue full")
else
print("Job added")
endif
else
returnValue = dequeue()
print("Queue empty")
else
output returnValue
endif
endif
endmain
Total 32
Examiner’s Comments
Exemplar 2
Total 4
Total 3
ii x, y, A 1 cao
Examiner's Comments
Total 9
15 CISC has a larger instruction set AO1.2 Accept any other valid pointsbr/>
RISC has a smaller instruction set (2) Mark in pairs
Total 2
Total 2
Examiner’s Comments
ii - A program called a 3
spider/crawler/bot (AO2.1)
- Traverses the web / following the Examiner’s Comments
links.
- It takes each word in the document This question was poorly attempted.
- …It adds an entry for the page Many candidates mentioned a
(under the word) in the index… crawler/spider program but then failed
- …alongside the word’s position on to clearly describe the process. Some
the page. candidates went on to discuss ranking
(1 Mark per -, Max 3) even though the question specifically
stated not to.
Total 11
18 advantage 2
- Costs less to design/produce.
because AO2.1
- Requires less cooling to be built in. (2)
- (If battery powered) can run off
smaller battery.
- Has fewer instructions than other
(CISC) processors. Examiner’s Comments
- Simpler (circuit/hardware)
design/manufacture. Some candidates did not gain credit
- Fewer transistors. because the advantage stated was not
(1 per -, max 2, 1 max from ‘because’ specific to the company, as the
group) question asked. Candidates should be
reminded to read the question
carefully.
Total 2
Spiral:
Incremental design
Includes planning, design,
programming and evaluation
At the end of all 4 phases it repeats
Each phase usually adds a new
element to the problem
Is used to manage risk
Prioritises riskiest elements first
Total 6
iii 1 mark for name 1 mark for description 2 Accept any sensible methodology and
e.g. description,
Total 8
Total 4
Total 6
23 i – Feasibility Study 3
– Investigation / Requirements
Elicitation
– Analysis
– Design
– Implementation / Coding
– Testing
– Installation
– Documentation
– Evaluation
– Maintenance
(1 per –, max 3)
Total 6
e.g.
The waterfall lifecycle establishes
requirements in early stages and
subsequent stages focus on these.
New requirements can be adopted
throughout XP. The requirements in
this project are likely to be static
making the Waterfall model a more
appropriate approach.
OR
Total 12