You are on page 1of 6

9618 Paper 4 – Practical evidence document

Centre Number: [Enter your centre number here]

Candidate Name: [Enter your name here Candidate number: [Enter your candidate number here]

Screenshots or Program Listings must be copied into appropriate cells in


the following table.

Examiners must be able to read the contents including any screenshots


without the use of a magnifying glass.

Answers that are not readable will not be awarded any marks.

Save this evidence document at regular intervals, for example every 5


minutes.

Question 1
Part 1(a)
{Copy and paste program code listing for question 1(a) here}

TheData = [20,3,4,8,12,99,4,26,4] #Integer

Part 1(b)
{Copy and paste program code listing for question 1(b) here}

def InsertionSort(TheData):
for count in range(len(TheData)):
DataToInsert = TheData[count]
Insert = 0
NextValue = count - 1
while NextValue >= 0 and Insert != 1 :
if DataToInsert < TheData[NextValue]:
TheData[NextValue + 1] = TheData[NextValue]
NextValue = NextValue -1
TheData[NextValue+1] = DataToInsert
else :
Insert = 1

Part 1(c)
{Copy and paste program code listing for question 1(c) here}

def Output(TheData):
for x in range(len(TheData)):
print(TheData[x])

1
9618 Paper 4 – Practical evidence document

Centre Number: [Enter your centre number here]

Candidate Name: [Enter your name here Candidate number: [Enter your candidate number here]

Part 1(d)(i)
{Copy and paste program code listing for question 1(d)(i) here}

print("Before sort : ")


Output(TheData)
InsertionSort(TheData)
print("After sort: ")
Output(TheData)

Part 1(d)(ii)
{Copy and paste the screenshots for question 1(d)(ii) here}

Part 1(e)(i)
{Copy and paste program code listing for question 1(e)(i) here}

Part 1(e)(ii)
2
9618 Paper 4 – Practical evidence document

Centre Number: [Enter your centre number here]

Candidate Name: [Enter your name here Candidate number: [Enter your candidate number here]

{Copy and paste the screenshots for question 1(e)(ii) here}

Question 2
Part 2(a)
{Copy and paste program code listing for question 2(a) here}

class HiddenBox :
def __init__(self,BoxName, Creator,DateHidden, GameLocation):
#BoxName : String
#Creator : String
#DateHidden : String
#GameLocation : String
#LastFinds : Array of String
#Active : Boolean

Part 2(b)
{Copy and paste program code listing for question 2(b) here}

self.BoxName = BoxName
self.Creator = Creator
self.DateHidden = DateHidden
self.GameLocation = GameLocation
LastFinds = [[""]*2]*10
self.Active = False

Part 2(c)
{Copy and paste program code listing for question 2(c) here}

def GetBoxName(self):
return self.BoxName
def GetGameLocation(self):
return self.GameLocation

Part 2(d)(i)

3
9618 Paper 4 – Practical evidence document

Centre Number: [Enter your centre number here]

Candidate Name: [Enter your name here Candidate number: [Enter your candidate number here]

{Copy and paste program code listing for question 2(d)(i) here}

TheBoxes = [HiddenBox("","","","")]*10000 #Array of HiddenBox

Part 2(d)(ii)
{Copy and paste program code listing for question 2(d)(ii) here}

def NewBox():
global TheBoxes
BoxName = input("Enter the box name: ")
Creator = input("Name of the creator: ")
DateHidden = input("Date hidden: ")
GameLocation = input("Location: ")
TheBoxes.append(HiddenBox(BoxName,Creator,DateHidden,GameLocation))

Part 2(d)(iii)
{Copy and paste program code listing for question 2(d)(iii) here}

m = NewBox()

Part 2(e)
{Copy and paste program code listing for question 2(e) here}

Question 3
Part 3(a)
{Copy and paste program code listing for question 3(a) here}

QueueData = [""]*20 #String


SP = 0
EP = 0

Part 3(b)
4
9618 Paper 4 – Practical evidence document

Centre Number: [Enter your centre number here]

Candidate Name: [Enter your name here Candidate number: [Enter your candidate number here]

{Copy and paste program code listing for question 3(b) here}

def Enqueue(item):
global QueueData
global EP
try:
QueueData[EP] = item
EP = EP + 1
return True
except :
return False

Part 3(c)
{Copy and paste program code listing for question 3(c) here}

def ReadFile():
filename = input("Enter a filename: ")
try :
r = open(filename, "r")
Flag = True
DataToInsert = (r.readline()).strip()
while (Flag == True and DataToInsert != ""):
Flag = Enqueue(QueueData)
DataToInsert = (r.readline()).strip()
r.close()
if Flag == False :
return 1
if Flag == True :
return 2
except :
return -1

Part 3(d)(i)
{Copy and paste program code listing for question 3(d)(i) here}

m = ReadFile()
if m == -1 :
print("File is not found")
elif m == 2 :
print("Process Successful")
elif m == 1 :
print("The array is full")

5
9618 Paper 4 – Practical evidence document

Centre Number: [Enter your centre number here]

Candidate Name: [Enter your name here Candidate number: [Enter your candidate number here]

Part 3(d)(ii)
{Copy and paste program code listing for question 3(d)(ii) here}

Part 3(e)
{Copy and paste program code listing for question 3(e) here}

You might also like