Computer Science For First Examination In 2021 9618 · 11

Programming

258 questions. Open a question to solve it and check the official answer.

2023 May-June · Paper 41 · Q3(d)(ii)

Constructs · 1 mark · official answer ready

(ii) Test your program. Take a screenshot of the output. Save your program. Copy and paste the screenshot into part 3(d)(ii) in the evidence document. [1] 11 12 Permission to repr…

2023 May-June · Paper 42 · Q3(e)(ii)

Constructs · 1 mark · official answer ready

(ii) Test your program. Take a screenshot of the output. Save your program. Copy and paste the screenshot into part 3(e)(ii) in the evidence document. [1] Permission to reproduce …

2023 May-June · Paper 43 · Q1(b)(i)

Structured programming · 3 marks · official answer ready

(i) The procedure PrintArray() takes an integer array as a parameter and outputs the contents of the array in the order they are stored. The items are printed on the same line, fo…

2023 May-June · Paper 43 · Q1(b)(ii)

Structured programming · 1 mark · official answer ready

(ii) Amend the main program to output the contents of DataArray using the procedure PrintArray() Save your program. Copy and paste the program code into part 1(b)(ii) in the evide…

2023 May-June · Paper 43 · Q1(d)(i)

Programming basics · 4 marks · official answer ready

(i) Amend the main program to: • prompt the user to input a whole number between 0 and 100 inclusive • read and validate the input from the user • call LinearSearch() with DataArr…

2023 May-June · Paper 43 · Q2(b)(ii)

Constructs · 4 marks · official answer ready

(ii) The Helicopter method IncreaseSpeed() overrides the method from the parent class and: • adds the amount of vertical change to the vertical position • adds IncreaseAmount to t…

2023 May-June · Paper 43 · Q2(c)

Constructs · 3 marks · official answer ready

(c) A procedure needs to output the horizontal position and speed of a vehicle. If the vehicle is a helicopter, it also outputs the vertical position. All outputs must include app…

2023 May-June · Paper 43 · Q3(b)(ii)

Structured programming · 3 marks · official answer ready

(ii) Study the pseudocode function PopAnimal(): FUNCTION PopAnimal() RETURNS STRING DECLARE ReturnData : STRING IF AnimalTopPointer = 0 THEN RETURN "" ELSE ReturnData Animal[Anima…

2023 May-June · Paper 43 · Q3(b)(iii)

Constructs · 5 marks · official answer ready

(iii) The procedure ReadData(): • reads the animal names from the file AnimalData.txt • uses PushAnimal() to insert each name onto the stack • uses appropriate exception handling …

2023 May-June · Paper 43 · Q3(c)

Constructs · 5 marks · official answer ready

(c) The procedure OutputItem(): • pops the next item from both Animal and Colour • outputs the colour and animal on one line, for example "black horse" If there is no data in Colo…

2023 May-June · Paper 43 · Q3(d)(ii)

Constructs · 1 mark · official answer ready

(ii) Test your program. Take a screenshot of the output. Save your program. Copy and paste the screenshot into part 3(d)(ii) in the evidence document. [1] 11 12 Permission to repr…

2022 October-November · Paper 13 · Q10(a)

Programming basics · 3 marks · official answer ready

10 (a) Explain the importance of feedback in a control system. ....................................................................................................................…

2022 October-November · Paper 13 · Q10(b)(i)

Constructs · 2 marks · official answer ready

(i) Identify one sensor that could be used in a car alarm system. Justify your choice. Sensor .....................................................................................…

2022 October-November · Paper 13 · Q10(b)(ii)

Constructs · 3 marks · official answer ready

(ii) The car alarm is an example of an embedded system. Describe the characteristics of an embedded system. .......................................................................…

2022 October-November · Paper 21 · Q1(b)(ii)

Programming basics · 2 marks · official answer ready

(ii) The following pseudocode statement includes array references: OUTPUT "Student ", Name[Count], " scored ", Mark[Count] State the purpose of the variable Count and give its dat…

2022 October-November · Paper 21 · Q1(c)

Constructs · 4 marks · official answer ready

(c) The pseudocode statements in the following table may contain errors. State the error in each case or write ‘NO ERROR’ if the statement contains no error. Assume that any varia…

2022 October-November · Paper 21 · Q8(b)

Constructs · 2 marks · official answer ready

(b) CountErrors() is called to check the project file Jim01Prog.txt and to stop if more than 20 errors are found. Write the pseudocode statement for this call. ...................…

2022 October-November · Paper 21 · Q8(d)

Constructs · 2 marks · official answer ready

(d) Module CheckLine() includes a check for syntax errors. Two examples of syntax error that cannot be detected from examining a single line are those involving selection and iter…

2022 October-November · Paper 22 · Q2(b)

Programming basics · 4 marks · official answer ready

(b) Examine the following state-transition diagram. Input-A Output-X Input-B Output-W Input-B START S1 S2 S3 Input-A Input-A Input-B S4 Input-A Output-W Complete the table to show…

2022 October-November · Paper 22 · Q3(c)

Constructs · 5 marks · official answer ready

(c) A second stack is used in the program. The diagram below shows the initial state of this stack. Value X is at the top of the stack and was the last item added. Upper-case lett…