Past-paper question · 2015 October-November · Paper 21 · Q8(b)(iii)

Question 8(b)(iii) 2015 · October-November · Paper 21 · 3 marks

Original past-paper question for 8(B)(III)
Original past-paper question for 8(B)(III)
Original past-paper question for 8(B)(III)
Original past-paper question for 8(B)(III)
Reveal official mark-scheme answer Official mark-scheme answer for 8(B)(III)

Official answer for Question 8

Part (b)

(iii)

(iii)

7

[1]

Mark scheme 9608_w15_ms_21.pdf →

Show text version of question

Question 8

Part (b)

(iii)

Question 8

In this question you will need to use the given pseudocode built-in function: ONECHAR(ThisString : STRING, Position : INTEGER) RETURNS CHAR returns the single character at position Position (counting from the start of the string with value 1) from the string ThisString. For example: ONECHAR("Barcelona", 3) returns 'r'.

Part (b)

Study the sequence of pseudocode statements.

Show the values assigned to each variable. ← FractionString "3/7+2/9" ← N3Char ONECHAR(FractionString, 5)

(i)

N3Char ....................................

[1]

← Op ONECHAR(FractionString, 4)

(ii)

Op ..............................................

[1]

(iii)

Complete the function call to isolate the character '9' from FractionString. ← FractionString "3/7+2/9" ONECHAR(FractionString, ............... )

[1]

The following additional variables are to be used by the program: Identifier Data type Description N1 INTEGER The number value of N1Char N2 INTEGER The number value of N2Char N3 INTEGER The number value of N3Char N4 INTEGER The number value of N4Char TopAnswer INTEGER The numerator of the fraction answer BottomAnswer INTEGER The denominator of the fraction answer

Question 18

Topic relevance

Why this question appears here

92% assigned-topic match · Data types and structures › Data types and records

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_w15_qp_21.pdf

Keep practising this topic