Cambridge A Level Computer Science 9608 — 2018 Oct/Nov Paper 2 · Variant 1
9608/21/O/N/18 · 75 marks · ≈84 min
The question paper and its mark scheme, free to read here and free to download. This is Cambridge’s own paper, exactly as it was sat.
Question paper16 pages
















Mark scheme12 pages
Answers below. Sit the paper first if you are practising.












Paper as text
Question paper, page 1
This document consists of 16 printed pages. DC (NH/CT) 150984/4 © UCLES 2018 [Turn over * 9 6 4 4 5 1 3 5 9 3 * COMPUTER SCIENCE 9608/21 Paper 2 Fundamental Problem-solving and Programming Skills October/November 2018 2 hours Candidates answer on the Question Paper. No Additional Materials are required. No calculators allowed. READ THESE INSTRUCTIONS FIRST Write your Centre number, candidate number and name in the spaces at the top of this page. Write in dark blue or black pen. You may use an HB pencil for any diagrams, graphs or rough working. Do not use staples, paper clips, glue or correction fluid. DO NOT WRITE IN ANY BARCODES. Answer all questions. No marks will be awarded for using brand names of software packages or hardware. At the end of the examination, fasten all your work securely together. The number of marks is given in brackets [ ] at the end of each question or part question. The maximum number of marks is 75. Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level
Question paper, page 2
2 9608/21/O/N/18 © UCLES 2018 Question 1 begins on the next page. Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity. To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge International Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after the live examination series. Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge.
Question paper, page 3
3 9608/21/O/N/18 © UCLES 2018 [Turn over 1 (a) The following table contains statements written in pseudocode. Show what type of programming construct each statement represents. Put a tick (3) in the appropriate column for each statement. Statement Selection Repetition (Iteration) Assignment WHILE Count < 20 Count Count + 1 IF MyGrade <> 'C' THEN Mark[Count] GetMark(StudentID) ELSE OUTPUT "Fail" ENDFOR [6] (b) (i) The following table contains statements written in pseudocode. Give the most appropriate data type for the variable used in each statement. Statement Data type MyAverage 13.5 ProjectCompleted TRUE Subject "Home Economics" MyMark 270 MyGrade 'B' [5] (ii) The following table contains statements written in pseudocode. Complete the table by evaluating each expression using the values from part (b)(i). If any expression is invalid, write “ERROR” in the Evaluates to column. For the built-in functions list, refer to the Appendix on page 16. Expression Evaluates to "Air-" & MID(Subject, 7, 3) INT(MyAverage / 2) ProjectCompleted AND MyMark > 270 ProjectCompleted OR MyMark > 260 ASC(MyGrade / 3) [5]
Question paper, page 4
4 9608/21/O/N/18 © UCLES 2018 2 Shop customers have a discount card with a unique card number. Customers collect points after they have bought items. The more points they have, the bigger the discount. If they shop on a Wednesday, their discount is increased by 20%. The function GetDiscountRate() takes a card number as a parameter and returns the discount rate for a customer based on the number of points they have collected. A flowchart for the function is shown. The function uses the following variables and functions. Identifier Data type Description DRate REAL The discount rate CardNum STRING The unique customer card number Points INTEGER The number of points collected GetPoints() FUNCTION Takes the card number as a parameter and returns the number of points already collected Today() FUNCTION Returns the day number: 1 for Monday, 2 for Tuesday etc. START Points GetPoints(CardNum) DRate 0 Is Points > 199 ? Is Points > 99 ? Is Today = Wednesday ? DRate 0.2 DRate 0.1 DRate DRate * 1.2 RETURN DRate END YES YES YES NO NO NO
Question paper, page 5
5 9608/21/O/N/18 © UCLES 2018 [Turn over (a) Write pseudocode to implement the GetDiscountRate() function. Your solution should follow the flowchart for the function as closely as possible. Variable declarations should be included. … … … … … … … … … … … … … … … … … … … … … … … …[8]
Question paper, page 6
6 9608/21/O/N/18 © UCLES 2018 (b) A programmer writes the function GetDiscountRate() in a high-level language. (i) A run-time error could occur when the function is used. Name and describe one other type of error that the function could contain. Name … Description … … … [2] (ii) Function GetPoints() has not been written yet. Name and describe a strategy that can be used to test GetDiscountRate() before the GetPoints() function has been written. Name … Description … … … [2] (c) There are different ways to minimise the risk of errors when writing programs, such as the use of constants and library routines. (i) Identify two values that could be replaced by constants in the function GetDiscountRate(). … …[1] (ii) Write pseudocode to declare one of the constants you have given in part (c)(i). …[2] (iii) Explain how the use of constants helps to minimise programming errors. … … … …[2]
Question paper, page 7
7 9608/21/O/N/18 © UCLES 2018 [Turn over (iv) Give a reason why the use of library routines helps to minimise the risk of errors when writing a program. … …[1] (v) Constants and library routines help to minimise the risk of errors. Name another way that you can minimise the risk of errors when writing a program. Explain how this helps. Name … Explanation … … … [2]
Question paper, page 8
8 9608/21/O/N/18 © UCLES 2018 3 (a) State why a high-level language program must be translated before it can be run. … …[1] (b) A program runs but does not give the expected output. Describe two methods you could use to find the error. Method 1 … … … … Method 2 … … … … [4] (c) Two testing methods are black-box and white-box. A student is choosing test data for both methods. Tick one or more boxes in each row to identify the testing method each statement describes. Statement White-box Black-box The student does not need to know the structure of the code. The student chooses data to test every possible path through the code. The student chooses normal, boundary and erroneous data. The student chooses data to test that the program meets the specification. [4]
Question paper, page 9
9 9608/21/O/N/18 © UCLES 2018 [Turn over Question 4 begins on the next page.
Question paper, page 10
10 9608/21/O/N/18 © UCLES 2018 4 Part of a program written in pseudocode is shown. 01 DECLARE NumElements : INTEGER … 10 FUNCTION ScanArray(SearchString : STRING) RETURNS INTEGER 11 12 DECLARE ArrayIndex : INTEGER 13 DECLARE ArrayString : STRING 14 DECLARE NumberFound : INTEGER 15 16 ArrayIndex 0 17 NumberFound 0 18 19 FOR ArrayIndex 1 TO NumElements 20 ArrayString ResultArray[ArrayIndex, 1] 21 IF ArrayString = SearchString 22 THEN 23 CALL SaveToFile(ArrayString) 24 NumberFound NumberFound + 1 25 ENDIF 26 ENDFOR 27 28 RETURN NumberFound 29 30 ENDFUNCTION (a) (i) Examine the pseudocode and complete the following table. Answer The identifier name of a global integer The identifier name of a user-defined procedure The line number of an unnecessary statement The scope of ArrayString [4] (ii) Describe in detail the purpose of lines 19 to 26 in the function ScanArray(). Do not use pseudocode in your answer. … … … … … … …[4]
Question paper, page 11
11 9608/21/O/N/18 © UCLES 2018 [Turn over (b) The function ScanArray() needs to be amended so that the comparison is not case sensitive. For example, comparing “Aaaa” with “AAAa” should evaluate to TRUE. Write program code to implement the amended ScanArray() function. Visual Basic and Pascal: You should include the declaration statements for variables. Python: You should show a comment statement for each variable used with its data type. Programming language … Program code … … … … … … … … … … … … … … … … … … … … … … …[6]
Question paper, page 12
12 9608/21/O/N/18 © UCLES 2018 (c) The function ScanArray() is one of a number of sub-tasks within a program. Name the process that involves the splitting of a problem into sub-tasks and state two advantages of this approach. Name … Advantage 1 … … Advantage 2 … … [3] (d) ResultArray is a 2D array of type STRING. It represents a table containing 100 rows and 2 columns. Write program code to declare ResultArray and set all elements to the value '*'. Programming language … Program code … … … … … … … …[3]
Question paper, page 13
13 9608/21/O/N/18 © UCLES 2018 [Turn over Question 5 begins on the next page.
Question paper, page 14
14 9608/21/O/N/18 © UCLES 2018 5 A program collects data about the performance of a car at regular time intervals. A text file, CarStatus.txt, stores the data. The format of each line of the text file is as follows: <Time>,<Amount of fuel used>,<Distance travelled> Data items are separated by a ‘,’ (comma) character. The program contains the following functions. Function Description GetTime() Returns a string representing the current time. May return NULL under certain circumstances. GetFuel() Returns a string representing the amount of fuel used GetDistance() Returns a string representing the distance travelled The function SaveStatus() will: • obtain the time, fuel used and distance data using the appropriate function calls • check that the time string is not NULL • return FALSE if the current time string remains NULL after three attempts • form the text string, write it to the file and return TRUE The file should not be open longer than necessary.
Question paper, page 15
15 9608/21/O/N/18 © UCLES 2018 [Turn over Write pseudocode for the SaveStatus() function. … … … … … … … … … … … … … … … … … … … … … … … … … … … …[10]
Question paper, page 16
16 9608/21/O/N/18 © UCLES 2018 Appendix Built-in functions (pseudocode) In each function, if the function call is not properly formed, the function returns an error. MID(ThisString : STRING, x : INTEGER, y : INTEGER) RETURNS STRING returns a string of length y starting at position x from ThisString Example: MID("ABCDEFGH", 2, 3) returns string "BCD" LENGTH(ThisString : STRING) RETURNS INTEGER returns the integer value representing the length of ThisString Example: LENGTH("Happy Days") returns 10 LEFT(ThisString : STRING, x : INTEGER) RETURNS STRING returns leftmost x characters from ThisString Example: LEFT("ABCDEFGH", 3) returns string "ABC" RIGHT(ThisString: STRING, x : INTEGER) RETURNS STRING returns rightmost x characters from ThisString Example: RIGHT("ABCDEFGH", 3) returns string "FGH" TO_UPPER(ThisString : STRING) RETURNS STRING returns a string formed by converting all lower case alphabetic characters of ThisString to upper case. Other characters will be unchanged. Example: TO_UPPER("Disk Error 27") returns "DISK ERROR 27" INT(x : REAL) RETURNS INTEGER returns the integer part of x Example: INT(27.5415) returns 27 ASC(ThisChar : CHAR) RETURNS INTEGER returns the ASCII value of character ThisChar Example: ASC('A') returns 65 Operators (pseudocode) Operator Description & Concatenates (joins) two strings Example: "Summer" & " " & "Pudding" produces "Summer Pudding" AND Performs a logical AND on two Boolean values Example: TRUE AND FALSE produces FALSE OR Performs a logical OR on two Boolean values Example: TRUE OR FALSE produces TRUE
Mark scheme, page 1
This document consists of 12 printed pages. © UCLES 2018 [Turn over Cambridge Assessment International Education Cambridge International Advanced Subsidiary and Advanced Level COMPUTER SCIENCE 9608/21 Paper 1 Written Paper October/November 2018 MARK SCHEME Maximum Mark: 75 Published This mark scheme is published as an aid to teachers and candidates, to indicate the requirements of the examination. It shows the basis on which Examiners were instructed to award marks. It does not indicate the details of the discussions that took place at an Examiners’ meeting before marking began, which would have considered the acceptability of alternative answers. Mark schemes should be read in conjunction with the question paper and the Principal Examiner Report for Teachers. Cambridge International will not enter into discussions about these mark schemes. Cambridge International is publishing the mark schemes for the October/November 2018 series for most Cambridge IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level components.
Mark scheme, page 2
9608/21 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2018 © UCLES 2018 Page 2 of 12 Generic Marking Principles These general marking principles must be applied by all examiners when marking candidate answers. They should be applied alongside the specific content of the mark scheme or generic level descriptors for a question. Each question paper and mark scheme will also comply with these marking principles. GENERIC MARKING PRINCIPLE 1: Marks must be awarded in line with: • the specific content of the mark scheme or the generic level descriptors for the question • the specific skills defined in the mark scheme or in the generic level descriptors for the question • the standard of response required by a candidate as exemplified by the standardisation scripts. GENERIC MARKING PRINCIPLE 2: Marks awarded are always whole marks (not half marks, or other fractions). GENERIC MARKING PRINCIPLE 3: Marks must be awarded positively: • marks are awarded for correct/valid answers, as defined in the mark scheme. However, credit is given for valid answers which go beyond the scope of the syllabus and mark scheme, referring to your Team Leader as appropriate • marks are awarded when candidates clearly demonstrate what they know and can do • marks are not deducted for errors • marks are not deducted for omissions • answers should only be judged on the quality of spelling, punctuation and grammar when these features are specifically assessed by the question as indicated by the mark scheme. The meaning, however, should be unambiguous. GENERIC MARKING PRINCIPLE 4: Rules must be applied consistently e.g. in situations where candidates have not followed instructions or in the application of generic level descriptors. GENERIC MARKING PRINCIPLE 5: Marks should be awarded using the full range of marks defined in the mark scheme for the question (however; the use of the full mark range may be limited according to the quality of the candidate responses seen). GENERIC MARKING PRINCIPLE 6: Marks awarded are based solely on the requirements as defined in the mark scheme. Marks should not be awarded with grade thresholds or grade descriptors in mind.
Mark scheme, page 3
9608/21 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2018 © UCLES 2018 Page 3 of 12 Question Answer Marks 1(a)(i) Statement Selection Repetition (Iteration) Assignment WHILE Count < 20 9 Count ← Count + 1 9 If MyGrade <> 'C' THEN 9 Mark[Count] ← GetMark(StudentID) 9 ELSE OUTPUT "Fail" 9 ENDFOR 9 One mark for each row 6 1(b)(i) Statement Data type MyAverage ← 13.5 REAL ProjectCompleted ← TRUE BOOLEAN Subject ← "Home Economics" STRING MyMark ← 270 INTEGER MyGrade ← 'B' CHAR 5 1(b)(ii) Expression Evaluates to "Air-" & MID(Subject, 7, 3) "Air-con" INT(MyAverage / 2) 6 ProjectCompleted AND MyMark > 270 FALSE ProjectCompleted OR MyMark > 260 TRUE ASC(MyGrade / 3) ERROR 5
Mark scheme, page 4
9608/21 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2018 © UCLES 2018 Page 4 of 12 Question Answer Marks 2(a) FUNCTION GetDiscountRate(CardNum : STRING) RETURNS REAL DECLARE DRate : REAL DECLARE Points : INTEGER DRate ← 0 Points ← GetPoints(CardNum) IF Points > 199 THEN DRate ← 0.2 ELSE IF Points > 99 THEN DRate ← 0.1 ENDIF ENDIF IF Today() = 3 THEN DRate ← DRate * 1.2 ENDIF RETURN DRate ENDFUNCTION 1 mark for each of the following: 1 Correct FUNCTION heading (as given) and end 2 Declaring local variables for DRate and Points 3 Initialisation of DRate to zero and Points ← GetPoints(CardNum) 4 IF « THEN ...(ELSE) … ENDIF with Points > 199 5 (Nested) IF ... THEN … ENDIF with Points > 99 6 «correct assignments of DRate to 0.2 and 0.1 7 Checking Today() = 3 and increasing DRate by 20% 8 Return parameter // GetDiscountRate ← DRate Mark points 7 and 8 must not be nested 8 2(b)(i) Name: Syntax Description: Rules of programming language have not been followed Name: Logic Description: Where the program does not behave as expected / does not give the expected result / an error in the logic of the algorithm 1mark for name + 1 mark for corresponding description 2 2(b)(ii) Name: Stub testing Description: A function could be written for GetPoints() that simply returns a test value or outputs a message (i.e. doesn't do the CardNum lookup) 2
Mark scheme, page 5
9608/21 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2018 © UCLES 2018 Page 5 of 12 Question Answer Marks 2(c)(i) 1 mark for any of the following two values: 0.1 0.2 1.2 99 199 3 1 2(c)(ii) Example: CONSTANT MinDiscount = 0.1 1 mark for each of the following: • meaningful identifier name and corresponding value • correct syntax 2 2(c)(iii) 1 mark for: • The value cannot accidentally get changed // be different in two places • A change to the value requires changing in one place only / don’t have to repeatedly write out the same value throughout the program 2 2(c)(iv) Tried and tested // pre compiled (contains no syntax errors) 1 2(c)(v) 1 mark for feature (Name) and 1 mark for corresponding description (explanation) Example: Name: Meaningful variable names Explanation: To reduce the risk of referring to the wrong variable / make the code easier to understand Name: Indentation Explanation: To see where loops / selection start / end // indicate program structure Name: Variable type-checking as part of module interface Explanation: Reduces the risk of using an incorrect parameter Name: Pretty-Printing Explanation: Highlights the error / auto-complete / type checking Name: / Dynamic Syntax Checking Explanation: Highlights the error as code is typed in 2
Mark scheme, page 6
9608/21 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2018 © UCLES 2018 Page 6 of 12 Question Answer Marks 3(a) Code has to be in machine code (or equivalent) to be executed 1 3(b) 1 mark for the name (what you do) and one for description (how) For example: Method: • Dry run the code // use of white box testing // trace tables • Trace the contents of variables // trace all possible routes through the program Method: • Breakpoints • Run the code to a set point to find error Method: • Variable watch • Check the contents of variables at specific points in the program Method: • Stepping • Execute the code line by line Method: • Include OUTPUT statements in the code • to display the value of variables as the code was running 4 3(c) Statement White-box Black-box The student does not need to know the structure of the code. 9 The student chooses data to test every possible path through the code. 9 The student chooses normal, boundary and erroneous data. 9 (9) The student chooses data to test that the program meets the specification. 9 1 mark per row 4
Mark scheme, page 7
9608/21 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2018 © UCLES 2018 Page 7 of 12 Question Answer Marks 4(a)(i) The identifier name of a global integer referenced NumElements The identifier name of a user-defined procedure SaveToFile The line number of an unnecessary statement 16 The scope of ArrayString Local 4 4(a)(ii) 1 mark for each mark point: • Loop / repeat / iterate through array ResultArray one element at a time • extract a string from row / column 1 of the array • compare the string with SearchString • if they match, call SaveToFile() and increment NumberFound 4 4(b) Pseudocode solution included here for development and clarification of mark scheme. Programming language solutions appear at the end of this mark scheme. FUNCTION ScanArray(SearchString : STRING) RETURNS INTEGER DECLARE ArrayIndex : INTEGER DECLARE ArrayString : STRING DECLARE NumberFound : INTEGER NumberFound ← 0 FOR ArrayIndex ← 1 TO NumElements ArrayString ← ResultArray[ArrayIndex, 1] IF TO_UPPER(ArrayString) = TO_UPPER(SearchString) THEN CALL SaveToFile(ArrayString) NumberFound ← NumberFound + 1 ENDIF ENDFOR RETURN NumberFound ENDFUNCTION 1 mark for each of the following: 1 Function header and end including parameter and return 2 Declaration of two local variables as above but NOT NumElements 3 FOR … ENDFOR loop with range as given 4 Referencing each element from the array 5 Converting both strings to uppercase / lowercase 6 If strings are equal then Call SaveToFile()and increment NumberFound 6
Mark scheme, page 8
9608/21 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2018 © UCLES 2018 Page 8 of 12 Question Answer Marks 4(c) 1 mark for name; 1 mark for each advantage (max 2) Name: Stepwise refinement // Top-down design // Modularisation // Decomposition Advantage: • Makes the problem / task / algorithm easier to understand // reduce program complexity • Smaller modules easier to develop / test / debug • Programmers can work on different modules // different expertise 3 4(d) Pseudocode solution included here for development and clarification of mark scheme. Programming language solutions appear at the end of this mark scheme. DECLARE ResultArray : ARRAY [1:100, 1:2] OF STRING DECLARE i, j : INTEGER FOR i ← 1 to 100 FOR j ← 1 to 2 ResultArray[i, j] ← '*' ENDFOR ENDFOR One mark for: • ResultArray declaration / commented in Python • assigning to all elements • assignment of ‘*’ 3
Mark scheme, page 9
9608/21 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2018 © UCLES 2018 Page 9 of 12 Question Answer Marks 5 FUNCTION SaveStatus() RETURNS BOOLEAN DECLARE Time : STRING DECLARE Fuel : STRING DECLARE Distance : STRING DECLARE FileData : STRING DECLARE Tries : INTEGER DECLARE ReturnFlag : BOOLEAN Tries ← 1 ReturnFlag ← TRUE Distance ← GetDistance() Fuel ← GetFuel() Time ← GetTime() WHILE Time = NULL AND Tries < 3 Time ← GetTime() Tries ← Tries + 1 ENDWHILE IF Time = NULL THEN ReturnFlag ← FALSE ELSE FileData ← Time & ',' & Fuel & ',' & Distance OPENFILE "CarStatus.txt" FOR APPEND WRITEFILE "CarStatus.txt", FileData CLOSEFILE "CarStatus.txt" ENDIF RETURN ReturnFlag ENDFUNCTION 1 mark for each of the following: 1 Function heading as shown 2 Declare Time local variable as STRING 3 Calls GetDistance()and GetFuel() once 4 Loop (up to three times or) until Time <> NULL 5 Call GetTime()in a loop 6 Return FALSE if 3 NULLs 7 Open file in APPEND mode 8 Forming the text string with comma separators and write to the file 9 OPEN « WRITE « CLOSE as three lines not separated by loop 10 Return TRUE 10
Mark scheme, page 10
9608/21 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2018 © UCLES 2018 Page 10 of 12 Program Code Solutions Q4 (b): Visual Basic Function ScanArray(SearchString As String) As Integer Dim ArrayIndex As Integer Dim ArrayString As String Dim NumberFound As Integer NumberFound = 0 For ArrayIndex = 1 To NumElements ArrayString = ResultArray(ArrayIndex, 1) If UCase(ArrayString) = UCase(SearchString) Then Call SaveToFile(ArrayString) NumberFound = NumberFound + 1 End If Next ArrayIndex Return NumberFound End Function Q4 (b): Pascal function ScanArray(SearchString : String) : Integer; var ArrayIndex : Integer; ArrayString : String; NumberFound : Integer; begin NumberFound := 0; For ArrayIndex := 1 To NumElements do begin ArrayString := ResultArray[ArrayIndex, 1]; If ToUpper(ArrayString) = ToUpper(SearchString) then begin SaveToFile(ArrayString); // Keyword "Call" not valid NumberFound := NumberFound + 1; end; end; Result := NumberFound; // ScanArray := NumberFound end.
Mark scheme, page 11
9608/21 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2018 © UCLES 2018 Page 11 of 12 Q4 (b): Python def ScanArray(SearchString): # ArrayIndex : integer # ArrayString : string # NumberFound : integer NumberFound = 0 for ArrayIndex in range(NumElements): # 0 to NumElements-1 ArrayString = ResultArray[ArrayIndex][0] if ArrayString.upper == SearchString.upper: SaveToFile(ArrayString) # Keyword "Call" not valid NumberFound = NumberFound + 1 return NumberFound # ScanArray := NumberFound
Mark scheme, page 12
9608/21 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2018 © UCLES 2018 Page 12 of 12 Q4 (d): Visual Basic Dim ResultArray(100, 2) As String Dim I, j As Integer For i = 1 to 100 For j = 1 to 2 ResultArray(i, j) = '*' Next j Next i Q4 (d): Pascal var ResultArray : array[1..100, 1..2] of string; i, j : integer; begin For i := 1 to 100 do For j := 1 to 2 do begin ResultArray[i, j] := '*'; end; end. Q4 (d): Python # ResultArray[1..100, 1..2] : String ResultArray = [[0] * 2 for i in range(100)] for i in range(100): for j in range(2): ResultArray[i][j] = '*' Q4 (d): Python – alternative 1 of n # ResultArray[1..100, 1..2] : String ResultArray = [['*'] * 2 for i in range(100)] Q4 (d): Python – alternative 2 of n # ResultArray[1..100, 1..2] : String ResultArray = [['*'] * 2] * 100
What you needed in this session
Cambridge’s own grade thresholds for 2018 Oct/Nov, Paper 2 · Variant 1. A higher threshold means an easier paper — the bar moves with how the cohort did.