Data types and structures
283 questions. Open a question to solve it and check the official answer.
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]
Data types and records · 1 mark · official answer ready
(iv) A statement which uses a built-in function of the programming language. .................... [1]
Data types and records · 2 marks · official answer ready
(iv) Give the global variable that needs to be declared at line 03. ...............................................................................................................…
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 .........................…
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…
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. ......................................................................…
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 …
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 .............…
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…
Data types and records · 2 marks · official answer ready
(i) FractionString ← "2/5-3/8" N1 N2 N3 N4 BottomAnswer Op TopAnswer OUTPUT [2]
Data types and records · 2 marks · official answer ready
(ii) FractionString ← "3/4+1/4" N1 N2 N3 N4 BottomAnswer Op TopAnswer OUTPUT [2]
Data types and records · 3 marks · official answer ready
(iii) FractionString ← "7/9+2/3" N1 N2 N3 N4 BottomAnswer Op TopAnswer OUTPUT [3]
Data types and records · 1 mark · official answer ready
(i) State the name for this type of maintenance. ..................................................................................................................................…
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…
Data types and records · 1 mark · official answer ready
(i) x ← CHARACTERCOUNT("New Delhi") + 3 x .......................................... [1]
Data types and records · 1 mark · official answer ready
(ii) y ← ONECHAR("Sri Lanka", 5) y .......................................... [1]
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
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 ← …
Data types and records · 2 marks · official answer ready
(ii) Describe the encryption algorithm used to encrypt the message string entered by the user. ....................................................................................…
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…
