Pseudocode Revision Sheet
Pseudocode Revision Sheet
sample.
Integer 'a'
Real 2
Char 2.0
String True
Boolean "Twelve"
[4]
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
......................................................................................................................................................[2]
3 Identify three different loop structures that you can use when writing pseudocode.
a. ..........................................................................................................................................
..........................................................................................................................................................
b. ..........................................................................................................................................
..........................................................................................................................................................
c. ..........................................................................................................................................
......................................................................................................................................................[3]
Page | 2
4 Four programming concepts and four examples of programming code are shown below.
Draw a line to link each programming concept to the correct example of programming code.
Programming
Example of programming code
concept
[4]
Page | 3
5 Read this section of program code that inputs 10 positive numbers and then outputs the smallest
number input.
1 Small = 1000
2 Counter = 0
3 REPEAT
4INPUT Num
5IF Num < Small THEN Small = Num
6Counter = Counter + 1
7 UNTIL Counter = 10
8 PRINT Small
Identify three changes you would need to make to find the largest number input instead
of the smallest number.
1 .........................................................................................................................................
...........................................................................................................................................
2 .........................................................................................................................................
...........................................................................................................................................
3 .........................................................................................................................................
.......................................................................................................................................[3]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
Page | 4
6 A program will be written to store information about members of a swimming
club. The following membership details will be recorded:
Name
Gender
Status:
Senior
Junior
Fee
Team member (Yes or No)
Choose a suitable data type for each of the membership details to be recorded.
Name
Gender
Status
Fee
Team member
[5]
Page | 5
7 REPEAT ... UNTIL is one type of loop structure.
Identify and describe two other types of loop structure that you could use when writing
pseudocode.
Description.................................................................................................................................
...................................................................................................................................................
Description.................................................................................................................................
...............................................................................................................................................[4]
Page | 6
8 Read this section of program code that inputs 10 positive numbers and then outputs the total.
1 Total = 0
2 Counter = 0
3 REPEAT
4INPUT Num
5Total = Total + Num
6PRINT Total
7Counter = Counter + 1
8 UNTIL Counter = 10
1.................................................................................................................................................
...................................................................................................................................................
2.................................................................................................................................................
...................................................................................................................................................
3.................................................................................................................................................
...............................................................................................................................................[3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
Page | 7
9 Four statement types and four examples are shown below.
Iteration READ X
Input PRINT X
Output X Y+Z
[3]
10 Identify two different selection statements that you can use when writing pseudocode.
........................................................................................................................................................
..........................................................................................................................................................
........................................................................................................................................................
......................................................................................................................................................[2]
Page | 8
11 Write an algorithm, using pseudocode, to input a number between 0 and 100 inclusive. The
algorithm should prompt for the input and output an error message if the number is outside this
range.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
Page | 9
12 (a) Write an algorithm to input three different numbers, and then output the largest number. Use
either pseudocode or a flowchart.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[4]
(b) Give two sets of test data to use with your algorithm in part (a) and explain why you chose
each set.
Test data set 1 ...........................................................................................................................
Reason ......................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Reason ......................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[4]
Page | 10
13 An algorithm has been written in pseudocode to input 100 numbers and print out the sum. A
REPEAT … UNTIL loop has been used.
Count ← 0
Sum ← 0
REPEAT
INPUT Number
Sum ← Sum + Number
Count ← Count + 1
UNTIL Count > 100
PRINT Sum
Error...........................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
[2]
(b) Rewrite the correct algorithm using a more suitable loop structure.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
Page | 11
.
14 (a) Write an algorithm to input 1000 numbers. Count how many numbers are positive and how
many numbers are zero. Then output the results. Use either pseudocode or a flowchart.
.................................................................................................................................................................
………...……………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
.……………………………………………………………………………………………………………………..
.................................................................................................................................................................
………...……………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………
.…………………………………………………………………………………………………………………[6]
(b) Give one change you could make to your algorithm to ensure initial testing is more
manageable.
...................................................................................................................................................
.............................................................................................................................................. [1]
Page | 12
15 Explain the difference between the programming concepts of counting and
totalling. Include an example of a programming statement for each concept in your
explanation.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..................................................................................................................................................... [4]
Page | 13
16 (a) Draw a flowchart for an algorithm to input numbers. Reject any numbers that are negative
and count how many numbers are positive. When the number zero is input, the process ends
and the count of positive numbers is output.
(b) Explain the changes you will make to your algorithm to also count the negative numbers.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
Page | 14
17 An algorithm is written in pseudocode:
INPUT Number
IF Number > 100
THEN OUTPUT ″The number is too large″
ELSE OUTPUT ″The number is acceptable″
ENDIF
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(b) (i) The algorithm only allows one attempt at inputting an acceptable value.
State how you would change the algorithm so that it continues until a suitable input is
supplied.
...........................................................................................................................................
.......................................................................................................................................[1]
(ii) Re-write the algorithm in full, using pseudocode, to implement your answer to part (b)(i).
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
Page | 15
18 Describe each of the following data types used in programming. In each case, give an
example of a piece of data to illustrate your answer. Each example must be different.
Char
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
String
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Boolean
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[6]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Page | 16
20 For each of the four groups of statements in the table, place a tick in the correct column to
show whether it is an example of Selection or Repetition.
21 Identify and describe three loop structures that are available in pseudocode.
..........................................................................................................................................................
Description .......................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Description .......................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Description .......................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[6]
Page | 17
22 Most programming languages include basic data types. Ahmad is describing the basic data
types he has used.
A number with a fractional part that can be positive or negative and used in calculations
A whole number that can be positive, negative or zero and used in calculations
A sequence of characters
Page | 18
23 Draw a line to connect each Description to the most appropriate Pseudocode example.
[4]
Page | 19
24 Draw the flowchart symbol for Decision and the flowchart symbol for Process.
Decision Process
[2]
Page | 20