question 1. · page 2 mark scheme syllabus paper cambridge international a level october/november...

38
Mark Scheme Syllabus Paper Cambridge International A Level – October/November 2015 9608 41 1 (a) (i) A F 5 B C E G 5 15 5 5 3 [max. 7] (ii) 1 – 2 – 3 – 5 – 6 – 7 – 9 – 8 – 10 1–5 scores 1 6–10 scores 1 [2] (iii) 43 weeks [1] (b) (i) week number 25 [1] (ii) week number 32 [1] (c) To see what activities can be done in parallel // show dependencies To record changes to project timings [max. 1] QUESTION 1.

Upload: others

Post on 01-Feb-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

  • Page 2 Mark Scheme Syllabus Paper

    Cambridge International A Level – October/November 2015 9608 41

    © Cambridge International Examinations 2015

    1 (a) (i)

    A F

    5

    B C E G

    5 15 5 53

    [max. 7] (ii) 1 – 2 – 3 – 5 – 6 – 7 – 9 – 8 – 10 1–5 scores 1 6–10 scores 1 [2] (iii) 43 weeks [1] (b) (i) week number 25 [1] (ii) week number 32 [1] (c) To see what activities can be done in parallel // show dependencies To record changes to project timings [max. 1]

    QUESTION 1.

  • Page 2 Mark Scheme Syllabus Paper

    Cambridge International A Level – October/November 2015 9608 42

    © Cambridge International Examinations 2015

    1 (a) (i) Activity

    A

    B

    C

    D

    E

    F

    G

    H

    J

    K

    L

    M

    N

    Week Number 1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    28

    29

    1 mark for each square [2] (ii) week number 18 Allow follow through [1]

    QUESTION 2.

  • Page 3 Mark Scheme Syllabus Paper

    Cambridge International A Level – October/November 2015 9608 42

    © Cambridge International Examinations 2015

    (b) (i)

    Activity Description Weeks to complete

    A Write requirement specification 1

    B Produce program design 1

    C Write module code 7

    D Module testing 2

    E Integration testing 2

    F Alpha testing 2

    G Install software and carry out acceptance testing 2

    H Research and order hardware 1

    J Install delivered hardware 3

    K Write technical documentation 4

    L Write user training guide 2

    M Train users on installed hardware and software 1

    N Sign off final system 1

    Activity

    A

    B

    C

    D

    E

    F

    G

    H

    J

    K

    L

    M

    N

    Week Number

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    28

    29

    1 mark per activity (but 1 mark for activity M and N) Notes: C must be after E (1 or 2 later is ok) D, E, F correct relative to C J must start in week 20 (allow 21, 22) G must come after the end of J (f.t.) K finishes after or at same time as F L finishes at the same time as G and after the end of J (or 1-2 weeks later) M starts when everything else has finished. N after or at same time as M [9]

    (ii) week number: 26 Allow f.t. [1]

  • Page 4 Mark Scheme Syllabus Paper

    Cambridge International A Level – October/November 2015 9608 42

    © Cambridge International Examinations 2015

    2 (a) parent(ali, ahmed). parent(meena, ahmed).

    Accept statements in either order Wrong capitalisation minus 1 mark [2] (b) P =

    ahmed

    aisha

    Ignore capitalisation Deduct 1 mark for every extra result [2]

    (c) mother(M, gina).

    Accept parent(M, gina) AND female(M). Accept a comma instead of AND

    Reject mother(M, gina) IF female(M) AND parent(M, gina).

    Ignore capitalisation [1] (d) father(F, C) IF

    male(F) AND parent(F, C).

    (1) (1) [2] (e) brother(X, Y) IF

    male(X)AND [1]

    parent(A, X) AND [1]

    parent(A, Y) [1]

    AND NOT X=Y. [1]

    Accept any variable for A, but it must be the same in both places Accept father/mother instead of parent Ignore capitalisation

  • Page 5 Mark Scheme Syllabus Paper

    Cambridge International A Level – October/November 2015 9608 42

    © Cambridge International Examinations 2015

    3 (a)

    Student

    StudentName : STRING DateOfBirth : DATETIME ……………………………………………………………………………………… ShowStudentName() ShowDateOfBirth() ………………………………………………………………………………………

    FullTimeStudent PartTimeStudent

    Address: STRING TelephoneNumber : STRING ………………………………………………………………………………………

    NumberOfCourses : INTEGER Fee : Currency FeePaid : BOOLEAN

    Constructor() ShowAddress() ShowTelephoneNumber() ………………………………………………………………………………………

    Constructor()ShowNumberOFCourses() ShowFee() ShowFeePaid()

    Mark as follows: Base class: – dateOfBirth declaration and associated method in Student – constructor Subclasses: – telephoneNumber declaration and associated method in FullTimeStudent – NumberOFCourses declaration and associated method in PartTimeStudent – fee declaration and associated method in PartTimeStudent – feepaid declaration and associated method in PartTimeStudent – constructor method in PartTimeStudent – inheritance arrows Ignore data types, ignore other methods/attributes Ignore brackets after methods [Max 7]

  • Page 6 Mark Scheme Syllabus Paper

    Cambridge International A Level – October/November 2015 9608 42

    © Cambridge International Examinations 2015

    (b) (i) Mark as follows (parts to be ignored in grey): If no programming language stated, map to 1 of the 3 below (or check in Q1ai) Class header & ending (watch out these may be squashed into the next clip) Ignore methods 2 attributes with correct data types No mark if subclass properties shown here Attributes required: StudentName DateOfBirth (accept variations e.g. DoB) Pascal TYPE Student = CLASS PUBLIC Procedure ShowStudentName(); Procedure ShowDateOfBirth(); PRIVATE StudentName : STRING; DateOfBirth : TDateTime; // accept string reject Date END;

    Python class Student : def __int__(self) : self.__StudentName = "" self.__DateOfBirth = "" # date(1,1,2015) def ShowStudentName() : pass def ShowDateOfBirth() : pass

    Ignore __ before attributes

    VB.NET Class Student Public Sub ShowStudentName() End Sub Public Sub ShowDateOfBirth() End Sub Private StudentName As String Private DateOfBirth As Date ‘ accept string End Class

    (Ignore: must inherit) Ignore Private/protected/public Don’t give a mark if using DIM [2]

  • Page 7 Mark Scheme Syllabus Paper

    Cambridge International A Level – October/November 2015 9608 42

    © Cambridge International Examinations 2015

    (ii) Mark as follows: – Class header and showing superclass

    – Properties (Do not award this mark if properties from base class included here) Data types must be correct – Methods (Do not award this mark if methods from base class included here) must show heading and ending of procedure/function declaration

    Ignore PUBLIC, PRIVATE Pascal TYPE FullTimeStudent = CLASS (Student) PUBLIC Procedure ShowAddress(); Procedure ShowTelephoneNumber(); PRIVATE Address : STRING; TelephoneNumber : STRING; // reject integer END;

    Python class FullTimeStudent(Student) : def __init__(self) : self.__Address = "" self.__TelephoneNumber = "" def ShowAddress() : pass def ShowTelephoneNumber() : pass

    VB.NET Class FullTimeStudent : Inherits Student Public Sub ShowAddress() End Sub Public Sub ShowTelephoneNumber() End Sub Private Address As String Private TelephoneNumber As String ‘ reject integer End Class

    No mark if using DIM [3]

  • Page 8 Mark Scheme Syllabus Paper

    Cambridge International A Level – October/November 2015 9608 42

    © Cambridge International Examinations 2015

    (iii) 1 mark per statement to max 3 Missing string delimiters: penalise once Accept use of constructor

    Pascal NewStudent := FullTimeStudent.Create; NewStudent.StudentName := 'A.Nyone'; NewStudent.DateOfBirth := EncodeDate(1990, 11,12);//:= ‘11/12/1990’ NewStudent.TelephoneNumber := '099111';

    Alternative NewStudent := FullTimeStudent.Create(‘A.Nyone’, ‘12/11/1990’, ‘099111’);

    Python NewStudent = FullTimeStudent() NewStudent.StudentName = "A.Nyone" NewStudent.DateOfBirth = "12/11/1990" NewStudent.TelephoneNumber = "099111"

    Alternative NewStudent = FullTimeStudent(‘A.Nyone’, ‘12/11/1990’, ‘099111’)

    VB.NET Dim NewStudent As FullTimeStudent = New FullTimeStudent() NewStudent.StudentName = "A.Nyone" NewStudent.DateOfBirth = #11/12/1990# NewStudent.TelephoneNumber = "099111"

    Alternative Dim NewStudent As FullTimeStudent = New FullTimeStudent(“A.Nyone”, “12/11/1990”, “099111”)

    [Max 3]

  • Page 9 Mark Scheme Syllabus Paper

    Cambridge International A Level – October/November 2015 9608 42

    © Cambridge International Examinations 2015

    4 (a) FUNCTION Hash(Key : STRING) RETURNS INTEGER DECLARE Number : INTEGER

    Number � ASCII(LEFTSTRING(Key,1))

    // Number � ASCII(Key[1])

    Number � Number – 64

    RETURN Number

    // Result � Number // Hash � Number ENDFUNCTION

    Accept ASC instead of ASCII

    Accept LEFT instead of LEFTSTRING

    Key can be a different identifier but must be the same in both places [5] (b) (i)

    Dictionary

    Index Key Value

    1

    2

    3 Computer Rechner

    4 Disk Platte

    5 Error Fehler

    6 File Datei

    7

    8

    : :

    : :

    1999

    2000

    Ignore spelling mistakes 1 mark for 2 correct pairs entered in correct slots [2]

    (ii) Collision / synonym / space already occupied / same index in array

    Overwrites previous key-value pair reject error [Max 2] (iii) Create an overflow area

    The 'home' record has a pointer to others with the same key // linked list

    OR Store the overflow record at the next available address … in sequence (= next available) OR Re-design the hash function …. // write a different/another algorithm to generate a wider range of indexes // enlarging storage space // to create fewer collisions [2]

  • Page 10 Mark Scheme Syllabus Paper

    Cambridge International A Level – October/November 2015 9608 42

    © Cambridge International Examinations 2015

    (iv) Mark as follows:

    Check whether slot is empty: IF Dictionary[Index,1] ”” // != ‘’ // > NULL // >

    NONE

    If not: update index: THEN Index �

    …to find an empty slot (loop / follow pointer / go to overflow area) reject FOR loop Insert code between lines 20 and 30

    21 WHILE Dictionary[Index,1] > ""

    22 Index � Index + 1 23 IF Index > 2000 24 THEN

    25 Index � 1 26 ENDIF

    27 ENDWHILE [4]

    5 (a) (i)

    Memory Address

    Accumulator 509 510 511 512

    0 7 3 0 0

    7 7

    0

    1 1

    7

    14 14

    1

    2 2

    14

    21 21

    2

    3 3

    3 marks 1 mark 1 mark

    If values changed in column 509 or 510 don’t give marks for 511/512 [5] (ii) stores the counter value for ….// acts as a control variable/counter How many times the loop has been performed // control the loop Ignore re-stating the steps [2] (b) LDM #12 (must be instruction before storage) STO 509 (must be final instruction) 1 mark for each instruction [2]

  • Page 11 Mark Scheme Syllabus Paper

    Cambridge International A Level – October/November 2015 9608 42

    © Cambridge International Examinations 2015

    6 (a) 1 mark for structure header/ending 1 mark for each field correct, take away 1 mark for additional fields Python answers will use a class

    Pascal TYPE StockItem = RECORD ProductCode : String; // accept integer Price : Currency; // accept real NumberInStock : Integer; END;

    Python class StockItem : def __init__(self) : self.ProductCode = "" # = 0 self.Price = 0.0 # = 0 self.NumberInStock = 0

    VB.NET STRUCTURE StockItem Dim ProductCode As String ‘ accept integer Dim Price As Decimal ‘ Double/single Dim NumberInStock As Integer END STRUCTURE

    VB6 Type StockItem ProductCode As String ‘ accept integer Price As Currency ‘ Double/single NumberInStock As Integer

    END Type [4]

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2017

    © UCLES 2017 Page 7 of 15

    Question Answer Marks

    5(a)(i) PERT / GANTT 1

    5(a)(ii) 1 mark per bullet to max 3 For example:

    • Calculate total minimum time required for project • Identify milestones • Task dependencies • Provides the critical path analysis • Identify which tasks need to be prioritised • Determine when to begin specific tasks/stages • Identify slack time • Identify when resources need allocating • Identify tasks that can be completed in parallel

    3

    5(b)(i) Integration 1

    5(b)(ii) Beta / acceptance 1

    Question Answer Marks

    6(a) 1 mark per bullet to max 6 • Declaring a class with the name animal • Declaring variables for across, down and score (all Integers) • as private/protected • Correct constructor header and ending • Randomly generating an across between 0–39 inc. in constructor • Randomly generating a down between 0–39 inc. in constructor • Initialising Score to zero in constructor • Correct get for Across • Correct set for Across

    6

    QUESTION 3.

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2018

    © UCLES 2018 Page 17 of 18

    Question Answer Marks

    5(c)(ii) 1 mark per bullet point to max 2: Example: • If there is any delay to a task which is part of the critical path • then the overall project will be delayed • Gives the earliest possible completion time • this allows you to organise/allocate resources (efficiently) • Frequently recalculate the critical path • to see if there are any delays/new critical path has arisen • Can identify where there is slack in activities • so they can start later without affecting the critical path

    2

    Question Answer Marks

    6(a)(i) 1 mark per bullet point: • Declaring a record type // class etc. • Declaring Country as a string • Declaring Pointer as an integer Example: TYPE ListElement DECLARE Country : STRING DECLARE Pointer : INTEGER ENDTYPE

    3

    QUESTION 4.

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 4 of 19

    Question Answer Marks

    1(a)(i) 1 mark for each correct Activity and time • B 3 • C 10 (following B) • D 7 (following B) • E 3 (following C and D) • G 2 (following F) • H 2 (following F)

    6

    1(a)(ii) The shortest time to complete the project // the sequence of activities that must be completed to avoid delaying the project 1

    1(a)(iii) 1 mark for identify, max 1 for description • GANTT • A table that has time across the top and activities on the left, boxes are coloured to show dependencies and find

    critical path // colour in the boxes to show the length of time for each task

    2

    1 2 3 5

    8

    6

    9

    4

    7

    A

    1

    F 1

    B

    3

    C

    10

    A

    1

    D 7

    H 2

    G2

    QUESTION 5.

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 5 of 19

    Question Answer Marks

    1(b)(i) A, B, C and D in correct places with no alteration to start and end pointer

    A B D C

    1

    1(b)(ii) 1 mark per bullet point

    • correct jobs in correct order • correct location of start pointer • correction location of new end pointer

    F G H D C E

    3

    1(b)(iii) 1 mark from: • An error message would be generated

    1

    Start Pointer End Pointer

    Start Pointer End Pointer

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 6 of 19

    Question Answer Marks

    1(b)(iv) 1 mark for each correct line FUNCTION Remove RETURNS STRING DECLARE PrintJob : STRING IF StartPointer = EndPointer THEN RETURN "Empty" ELSE PrintJob ← Queue[StartPointer] IF StartPointer = 5 THEN StartPointer ← 0 ELSE StartPointer ← StartPointer + 1 ENDIF RETURN PrintJob ENDIF ENDFUNCTION

    4

    1(b)(v) 1 mark per bullet point • A stack is Last In First Out (LIFO) while a queue is First In First Out (FIFO) • The queue removes and returns the element at start pointer // item is removed from the start/head // • A stack would remove and return the element at end pointer // item is removed from the end

    2

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 7 of 19

    Question Answer Marks

    1(c) 1 mark for each correct transition with arrow

    5

    Printer idle

    Printer active

    Job unsuccessful

    Print job received

    Print job successful

    Print job sent

    Print job in progress

    Timeout

    Error message

    Print job in progress

    Check print queue

    Print job added to queue

    Start

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 8 of 19

    Question Answer Marks

    1(d)(i) 1 mark per bullet • Way of modelling logic • Show all possible outputs // shows every possible outcome // all outcomes • based on the inputs • Determine which action to take in specific conditions // how different conditions affect the actions/outcomes

    2

    1(d)(ii) 1 mark for each row Accept Y/X/ticks as long as clear which are Y. Accept N/X/– for empty spaces

    Rules

    Conditions

    Document printed, but quality is poor Y Y Y Y N N N N

    Error light is flashing on printer Y Y N N Y Y N N

    Document printed, but paper size is incorrect Y N Y N Y N Y N

    Actions

    Check connection from computer to printer X

    Check ink status X X X X

    Check if there is a paper jam X

    Check paper size selected X X X X

    4

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 9 of 19

    Question Answer Marks

    1(d)(iii) 1 mark each for each correct column Accept –/X for empty spaces. Accept Y/X/Ticks as long as clear which are used

    Rules

    Conditions

    Document printed, but quality is poor Y Y N N N

    Error light is flashing on printer Y N

    Document printed, but paper size is incorrect Y N Y N N

    Actions

    Check connection from computer to printer X

    Check ink status X X

    Check if there is a paper jam X

    Check paper size selected X X

    5

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 10 of 19

    Question Answer Marks

    1(e)(i) 1 mark per bullet point to max 4 • Method header and close (where necessary) with three parameters • Initialised PrintID, FirstName, LastName and Credits • to the parameters • Initialised Credits to 50 PYTHON def__init__(self, NewFN, NewLN, NewPrintID): self.__PrintID = NewPrintID self.__FirstName = NewFN self.__LastName = NewLN self.__Credits = 50 PASCAL Constructor NewPrintAccount.Create(NewFN, NewLN, NewPrintID); begin PrintID := NewPrintID; FirstName = NewFN; LastName = NewLN; Credits := 50; end; VB Public Sub New(NewFN, NewLN, NewPrintID As String) PrintID = NewPrintID FirstName = NewFN LastName = NewLN Credits = 50 End Sub

    4

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 11 of 19

    Question Answer Marks

    1(e)(ii) 1 mark per bullet point • method/procedure header (and close where appropriate) taking a parameter • FirstName is set to parameter PYTHON def __SetFirstName(self, NewFirstName): self.__FirstName = NewFirstName PASCAL procedure SetFirstName(newFirstName : String); begin FirstName := newFirstName; end; VB public sub SetFirstName(NewFirstName As String) FirstName = NewFirstName End Sub

    2

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 12 of 19

    Question Answer Marks

    1(e)(iii) 1 mark per bullet point • concatenates FirstName, space and LastName • function/method header without parameter and returns (generated) value PYTHON def __GetName(self): return(self.__FirstName + " " + self.__LastName) PASCAL function GetName(); begin result := FirstName + " " + LastName end; VB public function GetName() As String return(FirstName & " " & LastName) End Function

    2

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 13 of 19

    Question Answer Marks

    1(e)(iv) 1 mark per each correct bullet point from: • Procedure/method header and close (where necessary) passing MoneyInput • At least 3 constants (e.g. freecredit10, freecredit20, twenty, 10, creditperdollar) • If MoneyInput9 and MoneyInput 19 then calculate MoneyInput * 25 + 50 • All three correct calculations add to Credits, not overwrite • Efficient IF (i.e. elseif) PYTHON def __AddCredits(self, MoneyInput): CreditPerDollar = 25 FreeCredit10 = 25 FreeCredit20 = 50 Twenty = 20 Ten = 10 if MoneyInput >= Twenty: Credits = Credits + (MoneyInput * CreditPerDollar) + FreeCredit20 elif MoneyInput >= Ten: Credits = Credits + (MoneyInput * CreditPerDollar) + FreeCredit10 else: Credits = Credits + (MoneyInput * CreditPerDollar)

    6

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 14 of 19

    Question Answer Marks

    1(e)(iv) PASCAL procedure AddCredits(MoneyInput : Real); const CreditPerDollar = 25 const FreeCredit10 = 25 const FreeCredit20 = 50 const Twenty = 20 const Ten = 10 begin If MoneyInput > = Twenty Then Credits := Credits + (MoneyInput * CreditPerDollar) + FreeCredit20; Else If MoneyInput > = Ten Then Credits := Credits + (MoneyInput * CreditPerDollar) + FreeCredit10; Else Credits := Credits + (MoneyInput * CreditPerDollar); end; VB.NET Public Sub AddCredits(MoneyInput As Integer) Const CreditPerDollar As Integer = 25 Const FreeCredit10 As Integer = 25 Const FreeCredit20 AS integer = 50 Const Twenty As Integer = 20 Const Ten AS Integer = 10 If MoneyInput > = Twenty Then Credits = Credits + (MoneyInput * CreditPerDollar) + FreeCredit20 Else If MoneyInput > = Ten Then Credits = Credits + (MoneyInput * CreditPerDollar) + FreeCredit10 Else Credits = Credits + (MoneyInput * CreditPerDollar) End If End Sub

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 15 of 19

    Question Answer Marks

    1(e)(v) 1 mark per bullet • Declaring StudentAccounts as array of 1000 elements • of type PrintAccount DECLARE StudentAccounts ARRAY[0:999] OF PrintAccount

    2

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 16 of 19

    Question Answer Marks

    1(e)(vi) 1 mark per bullet point to max 8 • Generating ID with ‘1’ at the end all in lowercase from parameters • Loop through array to last occupied element • Check if the PrintID already exists • using GetPrintID() • increment number at end of PrintID • Create a new instance of PrintAccount • sending FirstName, LastName, PrintID as parameters • adding new account to StudentAccounts at position NumberStudents • Increment NumberStudents VB.NET Sub CreateId(firstName, lastName) Dim count As Integer Dim PrintID = Left(firstname, 3).ToLower & Left(lastname, 3).ToLower & “1” Dim studentAdd As Integer = 0 If numberStudents 0 Then For x = 0 To numberStudents - 1 If studentAccounts(x).getPrintID() = username Then PrintID = PrintID + 1 username = Left(firstname, 3).ToLower & Left(lastname, 3).ToLower & PrintID.ToString End If Next studentAdd = numberStudents End If studentAccounts(studentAdd) = New printAccount(firstname, lastname, username) numberStudents = numberStudents + 1

    8

  • 9608/41 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 17 of 19

    Question Answer Marks

    1(e)(vi) Python def CreateID(firstname, lastname): count = 0 PrintID = firstname[0:3].lower() + lastname[-3].lower() + "1" StudentAdd = 0 if numberStudents != 0: for x in range(0, numberStudents): if studentAccounts[x].getPrintID() == username: PrintID = PrintID + 1 username = firstname[0:3].lower() + lastname[0:3].lower + str(PrintID) studentAdd = numberStudents studentAccounts[studentAdd] = printAccount(firstname, lastname, username) numberStudents = numberStudents + 1 Pascal procedure CreateID(firstname : String, lastname: String); var count : Integer; studentAdd : Integer; PrintID : String; begin studentAdd := 0; PrintID := LowerCase(substr(firstname,0,3)) + LowerCase(substr(lastname,0,3))+ "1"; if numberStudents 0: ror x := 0 To numberStudents - 1; if studentAccounts[x].getPrintID() = username: PrintID := PrintID + 1; username := LowerCase(substr(firstname, 3) + LowerCase(substr(lastname,0,3))+str(PrintID); studentAdd := numberStudents; studentAccounts[studentAdd] := printAccount.Create(firstname, lastname, username); numberStudents := numberStudents + 1

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 4 of 20

    Question Answer Marks

    1(a)(i) 1 mark each bullet point: • B 1 • C 3 (following B) • D 10 (following C) • G 3 (following D) and nothing on dummy • E 7 (following C) and nothing on dummy • H1 in position • J 2 (following H) and nothing on dummy

    7

    1(a)(ii) 1 mark: • The next activity is dependent on the previous but there is no activity

    1

    1 2A

    13 4

    5

    8

    7

    6

    9

    11 10

    F

    2

    2

    B

    1

    C I

    3

    D

    1

    G3

    E

    I

    7

    H1

    J2

    I

    6

    QUESTION 6.

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 5 of 20

    Question Answer Marks

    1(b) 1 mark per row

    Rules

    Conditions

    Public Holiday Y Y Y Y N N N N

    Hours >= 160 Y Y N N Y Y N N

    Pension Y N Y N Y N Y N

    Actions

    3% bonus payment X X X X

    5% bonus payment X X X X

    4% Pension payment X X X X

    3

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 6 of 20

    Question Answer Marks

    1(c)(i)

    Employee

    EmployeeID : STRING Name : STRING Address : STRING DateOfBirth : DATE

    Constructor () GetEmployeeID() GetName() GetAddress() GetDateOfBirth() SetEmployeeID() SetName() SetAddress() SetDateOfBirth()

    SalaryEmployee ApprenticeshipEmployee

    MonthlyPayment : CURRENCYHoursThisMonth : REAL PublicHoliday : BOOLEAN Pension : BOOLEAN

    HourlyRate : CURRENCY/REAL HoursThisWeek : REAL/INTEGER

    Constructor() GetMonthlyPayment() GetPension() GetPublicHoliday() GetHoursThisMonth() SetMonthlyPayment() SetPension() SetPublicHoliday() SetHoursThisMonth()

    Constructor() SetHoursThisWeek() GetHourlyRate() GetHoursThisWeek() SetHourlyRate()

    3 1 mark per bullet point • inheritance (arrow filled or unfilled) • constructor and SetHoursThisWeek method for

    ApprenticeshipEmployee • HourlyRate and HoursThisWeek attributes for

    ApprenticeshipEmployee

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 7 of 20

    Question Answer Marks

    1(c)(ii) 1 mark per bullet point • Constructor header and close (where necessary) • All 4 values sent as parameters (ID, Name, Address, DateOfBirth) with any • Attributes/properties set to a value • that are the parameters Example code: Pascal Constructor Employee.init(ID, NewName, NewAddress, NewDateOfBirth : String); begin EmployeeID := ID; Name := NewName; Address := NewAddress; DateOfBirth := NewDateOfBirth; end; Python def __init__(self, ID, NewName, NewAddress, NewDateOfBirth): self.__EmployeeID = ID self.__Name = NewName self.__Address = NewAddress self.__DateOfBirth = NewDateOfBirth VB.NET Public Sub New(ID, NewName, NewAddress, NewDateOfBirth) EmployeeID = ID Name = NewName Address = NewAddress DateOfBirth = NewDateOfBirth End Sub

    4

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 8 of 20

    Question Answer Marks

    1(c)(iii) 1 mark per bullet point • Get method header and close (where needed) with no parameters • Returns the attribute/property EmployeeID Example code: Pascal Function Employee.GetEmployeeID() : String; result := EmployeeID; end; Python def GetEmployeeID(self): return self.__EmployeeID VB.NET Public Function GetEmployeeID() As String Return EmployeeID End Function

    2

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 9 of 20

    Question Answer Marks

    1(c)(iv) 1 mark per bullet point • Set method/procedure header and close (where needed) with parameter • Sets EmployeeID to value of parameter Example code: Pascal procedure Employee.SetEmployeeID(NewID: String); EmployeeID := NewID end; Python def SetEmployeeID(self, NewID): self.__EmployeeID = NewID VB.NET Public Sub SetEmployeeID(NewID) EmployeeID = NewID End Sub

    2

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 10 of 20

    Question Answer Marks

    1(c)(v) 1 mark per bullet point • Set method/function header and close (where needed) with parameter • Checking value of parameter for both true and false • If valid – setting Pension to parameter and returning True • If not valid – not setting Pension and returning False Example code: Pascal Function salaryEmployee.SetPension(NewPension) : boolean; IF NewPension = true or NewPension = false THEN Pension := NewPension; Result := true; ELSE Result := false; end; Python def SetPension(self, NewPension): if NewPension == True Or NewPension == False: self.__Pension = NewPension return True else: return False VB.NET Public Function SetPension(NewPension) AS Boolean If NewPension = True Or NewPension = False Then Pension = NewPension Return True Else Return False End If End Function

    4

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 11 of 20

    Question Answer Marks

    1(c)(vi) 1 mark per bullet point to max 8 • Function header and close (where needed) with at least one parameter • Constants used for hours bonus, month bonus, holiday bonus, pension cost(at least 3) • Checking if Hours is > = 160, calculating bonus payment (monthlypay * 0.05) • Checking if pension is true, calculation pension to pay (monthlypay * 0.04) • Checking if public holiday is true, calculation of bonus payment (monthlypay * 0.03) • all 3 Hours, Pension and PublicHoliday accessed from the parameter using Get methods

    • Adding both bonus payments to basic salary and deducting pension from salary • basic salary accessed by using GetMonthlyPayment with the parameter • Outputting the total final bonus and pension with appropriate message • Returning the new salary Example code: Pascal Function CalculateMonthlySalary(TheEmployee : SalaryEmployee) : real; var BonusPayment : real; PensionPayment : real; BasicSalary : real; const HoursBonus : real = 0.05; HoursMonthBonus : integer = 160; PensionCost : real = 0.04; PublicHolidayBonus : real = 0.03; begin BonusPayment :=0; PensionPayment :=0; BasicSalary :=0;

    8

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 12 of 20

    Question Answer Marks

    1(c)(vi) BasicSalary := TheEmployee.GetMonthlyPayment(); IF TheEmployee.GetHoursThisMonth() >= HoursMonthBonus THEN BonusPayment := BasicSalary * HoursBonus; IF TheEmployee.GetPension() = True THEN PensionPayment := BasicSalary * PensionCost; IF TheEmployee.GetPublicHoliday() = True THEN BonusPayment := BonusPayment + BasicSalary * PublicHolidayBonus; writeln("The pension payment is " & PensionPayment); writeln ("The bonus payment is " & BonusPayment); MonthlySalary := BasicSalary + BonusPayment - PensionPayment; result := MonthlySalary; end; Python def CalculateMonthlySalary(TheEmployee): BonusPayment = 0 PensionPayment = 0 HoursBonus = 0.05 HoursMonthBonus = 160 PensionCost = 0.04 PublicHolidayBonus = 0.03 BasicSalary = TheEmployee.GetMonthlyPayment() if TheEmployee.GetHoursThisMonth() >= HoursMonthBonus: BonusPayment = BasicSalary * HoursBonus

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 13 of 20

    Question Answer Marks

    1(c)(vi) if TheEmployee.GetPension() == true: PensionPayment = BasicSalary * PensionCost if TheEmployee.GetPublicHoliday() == true: BonusPayment = BonusPayment + BasicSalary * PublicHolidayBonus print("The pension payment is ", str(PensionPayment)) print("The bonus payment is ", str(BonusPayment)) MonthlySalary = BasicSalary + BonusPayment - PensionPayment return MonthlySalary VB.NET Public Function CalculateMonthlySalary(TheEmployee As SalaryEmployee) As Double Dim BonusPayment As Single = 0 Dim PensionPayment As Single = 0 Dim MonthlySalary As Single = 0 Const HoursBonus As Single = 0.05 Const HoursMonthBonus As Integer = 160 Const PensionCost As Single = 0.04 Const PublicHolidayBonus As Single = 0.03 Dim BasicSalary As Double = TheEmployee.GetMonthlyPayment() If TheEmployee.GetHoursThisMonth() >= HoursMonthBonus Then BonusPayment = BasicSalary * HoursBonus End If If TheEmployee.GetPension() = True Then PensionPayment = BasicSalary * PensionCost End If If TheEmployee.GetPublicHoliday() = True Then BonusPayment = BonusPayment + BasicSalary * PublicHolidayBonus End If

  • 9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED

    October/November 2019

    © UCLES 2019 Page 14 of 20

    Question Answer Marks

    1(c)(vi) Console.WriteLine("The pension payment is " & PensionPayment) Console.WriteLine("The bonus payment is " & BonusPayment) MonthlySalary = BasicSalary + BonusPayment - PensionPayment Return MonthlySalary End Function

    1(d) Polymorphism 1