Past-paper question · 2018 October-November · Paper 22 · Q2(b)(i)

Question 2(b)(i) 2018 · October-November · Paper 22 · 2 marks

Original past-paper question for 2(B)(I)
Original past-paper question for 2(B)(I)
Original past-paper question for 2(B)(I)
Original past-paper question for 2(B)(I)
Original past-paper question for 2(B)(I)
Reveal official mark-scheme answer Official mark-scheme answer for 2(B)(I)

Official answer for Question 2

Part (b)

(i)

Question 1

mark for name, 1 mark for description

Question 2

✓
Name: Run-time
✓
Description: The program executes an illegal instruction // performs an
✓
illegal operation that is trapped by the OS

Mark scheme 9608_w18_ms_22.pdf →

Show text version of question

Question 2

Part (b)

(i)

Question 2

Shop customers have a discount card with a unique card number. Customers collect points each

time they buy items. The number of points they collect depends on:

  • the total amount they spend
  • the number of points already collected.

The function CalcPoints() takes the card number and the total amount spent as parameters. It returns the number of new points collected. A flowchart for the function is shown.

The function uses the following variables and functions.

Identifier Data type Description CardNum STRING A numeric string representing the unique card number OldPoints INTEGER The number of points already collected NewPoints INTEGER The number of new points collected Total REAL The amount spent Takes the card number as a parameter and returns the GetPoints() FUNCTION number of points already collected INT() FUNCTION Refer to the Appendix on page 16

START

Is YES Total > 100 ?

OldPoints NO GetPoints(CardNum)

Is NO OldPoints > 2000 ?

YES

NewPoints INT(Total * 1.2)

NewPoints 0 NewPoints INT(Total * 1.1)

RETURN NewPoints

END

Question 5

The function CalcPoints() is written in a high-level language. It has been checked and it does not contain any syntax or logic errors.

(i)

Name and describe one other type of error that the high-level language code could

contain.

Name .................................................................................................................................

Description ........................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

[2]
Topic relevance

Why this question appears here

72% assigned-topic match · Hardware › Logic gates and logic circuits

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_w18_qp_22.pdf

Keep practising this topic