Problem Solving Test 1
Problem Solving Test 1
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 41.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
returns a string value consisting of n characters from the string ThisString starting from
position x.
String1 ← "RED"
String2 ← "F"
(i) MID(String1, 3, 1)
.......................................................................................................................................[1]
(ii) MID(String1, 3, 2)
.......................................................................................................................................[1]
.......................................................................................................................................[1]
(i) Use all the functions described in part (a) to write the pseudocode required to reverse
the string.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[5]
Complete the Boolean expression to check whether the two strings, Original and
Reverse, are palindromes.
IF .....................................................................................................................................
THEN
ENDIF [1]
START
MyNumber
RANDOM(100)
Input Guess
Is Guess = 0 No Increment
? NumberOfGuesses
Yes
No Is EndGame
TRUE?
Yes
END
[6]
These programs will use data about daily sales made from Site X (using variable SalesX) and
Site Y (using variable SalesY).
28 01/07/2015 14 8
...............................................................................................................................................[2]
(b) The programmer writes a program from the following pseudocode design.
x 0
FOR DayNumber 1 TO 7
IF SalesX[DayNumber] + SalesY[DayNumber] >= 10
THEN
x x + 1
OUTPUT SalesDate[DayNumber]
ENDIF
ENDFOR
OUTPUT x
Describe, in detail, what this algorithm does.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
Draw a flowchart that shows the logic to validate the hand-in date. [5]
[4]
(b) Juan has little programming experience, but has to write code for this program. He has
written the following pseudocode statements.
For each statement describe what is wrong and write a correct version.
Description
Correct statement
[2]
Description
Correct statement
[2]
Description
Correct statement
[2]
Write pseudocode that processes the variable ResourceID and outputs where the
resource is kept. Use nested IF statements.
[6]