Computer Science 9608 · 10

Data types and structures

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

2015 October-November · Paper 21 · Q6(b)(iii)

Data types and records · 1 mark · official answer ready

(iii) The incrementing of a variable used as a counter, but not to control a ‘count controlled’ loop. .................... [1]

2015 October-November · Paper 21 · Q6(b)(iv)

Data types and records · 1 mark · official answer ready

(iv) A statement which uses a built-in function of the programming language. .................... [1]

2015 October-November · Paper 21 · Q6(c)(iv)

Data types and records · 2 marks · official answer ready

(iv) Give the global variable that needs to be declared at line 03. ...............................................................................................................…

2015 October-November · Paper 21 · Q7(a)

Data types and records · 4 marks

(a) Show the values stored by variables A, B, C and D. The & operator is used to concatenate two strings. Num1 ← 15 A ← CHR(67) & CHR(65) & CHR(84) (i) A .........................…

2015 October-November · Paper 21 · Q7(b)

Data types and records · 6 marks · official answer ready

(b) A program is to be written which accepts a string and then calculates a numeric value from this string. The input string and the calculated value are then to be sent to a remo…

2015 October-November · Paper 21 · Q7(c)

Data types and records · 2 marks · official answer ready

(c) Explain the purpose of sending the value of StringTotal to the remote computer, in addition to MyString. ......................................................................…

2015 October-November · Paper 21 · Q8(a)

Data types and records · 1 mark · official answer ready

(a) Give the value assigned to variable y by the following statement: y ← ONECHAR("San Francisco", 6) y ............................................. [1] A program reads a string …

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

Data types and records · 3 marks · official answer ready

(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 .............…

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

Data types and records · 3 marks · official answer ready

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 posit…

2015 October-November · Paper 21 · Q8(c)(i)

Data types and records · 2 marks · official answer ready

(i) FractionString ← "2/5-3/8" N1 N2 N3 N4 BottomAnswer Op TopAnswer OUTPUT [2]

2015 October-November · Paper 21 · Q8(c)(ii)

Data types and records · 2 marks · official answer ready

(ii) FractionString ← "3/4+1/4" N1 N2 N3 N4 BottomAnswer Op TopAnswer OUTPUT [2]

2015 October-November · Paper 21 · Q8(c)(iii)

Data types and records · 3 marks · official answer ready

(iii) FractionString ← "7/9+2/3" N1 N2 N3 N4 BottomAnswer Op TopAnswer OUTPUT [3]

2015 October-November · Paper 21 · Q8(d)(i)

Data types and records · 1 mark · official answer ready

(i) State the name for this type of maintenance. ..................................................................................................................................…

2015 October-November · Paper 22 · Q1

Data types and records · 5 marks · official answer ready

1 Computer programs have to evaluate expressions. Study the sequence of pseudocode statements. Give the value assigned to each variable. The statement may generate an error. If so…

2015 October-November · Paper 22 · Q6(a)(i)

Data types and records · 1 mark · official answer ready

(i) x ← CHARACTERCOUNT("New Delhi") + 3 x .......................................... [1]

2015 October-November · Paper 22 · Q6(a)(ii)

Data types and records · 1 mark · official answer ready

(ii) y ← ONECHAR("Sri Lanka", 5) y .......................................... [1]

2015 October-November · Paper 22 · Q6(b)(i)

Data types and records · 4 marks · official answer ready

(i) Complete the identifier table below. Identifier Data type Description InputString STRING The string value input by the user [4] 14

2015 October-November · Paper 22 · Q7(a)

Data types and records · 4 marks · official answer ready

(a) Give the values assigned to the variables A, B, C and D. The & operator is used to concatenate two strings. The expression could generate an error; if so, write ERROR. Num1 ← …

2015 October-November · Paper 22 · Q7(b)(ii)

Data types and records · 2 marks · official answer ready

(ii) Describe the encryption algorithm used to encrypt the message string entered by the user. ....................................................................................…

2015 October-November · Paper 23 · Q1

Data types and records · 4 marks · official answer ready

1 Computer programs have to evaluate expressions. Study the sequence of pseudocode statements. Write down the value assigned to each variable. DECLARE h, w, r, Perimeter, Area : R…