100% found this document useful (1 vote)
9K views6 pages

IGCSE Pseudocode Practice

The document outlines a series of programming exercises and questions related to concepts such as variables, constants, data types, algorithms, and control structures. It includes tasks for defining terms, linking data types to samples, writing pseudo code, and explaining programming concepts like sequence and selection. Additionally, it requires the completion of tables and algorithms to demonstrate understanding of programming fundamentals.

Uploaded by

faithmutero40
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
9K views6 pages

IGCSE Pseudocode Practice

The document outlines a series of programming exercises and questions related to concepts such as variables, constants, data types, algorithms, and control structures. It includes tasks for defining terms, linking data types to samples, writing pseudo code, and explaining programming concepts like sequence and selection. Additionally, it requires the completion of tables and algorithms to demonstrate understanding of programming fundamentals.

Uploaded by

faithmutero40
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Pseudo-code Revision

1. Explain the difference between a variable and a constant in a program. [2]


2. Five data types and five data samples are shown below. Draw a line to link each data type to
the correct data sample. [5]
3.

4. A marathon runner records their time for a race in hours, minutes and seconds. An algorithm is
shown below in structured English:
INPUT race time as hours, minutes and seconds
CALCULATE race time in seconds STORE race time in seconds
OUTPUT race time in seconds
The identifier table needs to show the variables required to write a program for this algorithm.
Complete the table.

5. A program contains the following code to calculate the circumference of a bicycle wheel, using
the wheel size (diameter).
CONSTANT Pi = 3.14
INPUT WheelSize
Circumference = Pi * WheelSize
OUTPUT Circumference
(a) The code uses one constant and two variables.
(i) State the names of the constant and the variables.
Constant:
............................................................................................................................................
Variables:
.......................................................................................................................................[2]
(ii) Explain one difference between a constant and a variable.
..............................................................................................................................................
..............................................................................................................................................
..........................................................................................................................................[2]
(b) The data type of WheelSize is integer and the data type of Circumference is real number.
Explain the difference between an integer and a real number.
..............................................................................................................................................
..............................................................................................................................................
..............................................................................................................................................
....................................................................................................................................... [2]
6. 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, write ERROR. The & operator is used to concatenate strings.

7. Describe, giving an example for each, the following data types used in programming. Integer
Description
..............................................................................................................................................
........................................................................................................................................
Example
............................................................................................................................................
String Description
..............................................................................................................................................
............................................................................................................................................
Example
....................................................................................................................................... [4]
8. Programming languages support different data types. Complete the table by giving a suitable
data type for each example value. [8]
9. Describe each of the following data types used in programming. In each case, give an
exampleof a piece of data to illustrate your answer. Each example must be different.

Char.......................................................................................................................................
..............................................................................................................................................
..............................................................................................................................................
String.....................................................................................................................................
..............................................................................................................................................
..............................................................................................................................................
Integer...................................................................................................................................
..............................................................................................................................................
..............................................................................................................................................
Real.......................................................................................................................................
..............................................................................................................................................
..............................................................................................................................................
Date.......................................................................................................................................
..............................................................................................................................................
..............................................................................................................................................
Boolean.................................................................................................................................
..............................................................................................................................................
........................................................................................................................................[12]
10. Write an algorithm, using flowchart only, which:
• Inputs two numbers
• Calculate their average
• Output average
11. a) Define the term algorithm, name the two ways of representing algorithm.
12. Simple algorithms usually consist of three different stages. Complete the table below. Write
each example statement in program code. The second stage has already been given. [5]

13. What is top-down design


..............................................................................................................................................
..............................................................................................................................................
.................................... ................................................................................................... [1]
14. Describe following terms and give one example of each
1. Library Routine
..............................................................................................................................................
..............................................................................................................................................
...................................................................................................................................... [1]
2. Sub-routine
..............................................................................................................................................
..............................................................................................................................................
........................................................................................................................................[1]
3. Function
..............................................................................................................................................
..............................................................................................................................................
..........................................................................................................................................[1]
4. Procedure
..............................................................................................................................................
..............................................................................................................................................
...................................................................................................................................... [1]
5. Rogue Value
..............................................................................................................................................
..............................................................................................................................................
......................................................................................................................................... [1]
15. Write algorithm using pseudo code for the following problems:
a) Input total weight of passengers in a lift output "Overloaded, step out" if Total Weight
isabove 600 otherwise output "Ready to go".
b) Input age of candidates for driving license, output "Not allowed to drive" or "Kindly fill
inthe form". The minimum allowed age for driving is 18 years.
c) Input age of candidate in an employment center, output "You are not eligible due to
age".Allowed age is between 18 and 60 both inclusive.
d) which inputs price and quantity calculates amount and if billing amount is above
5000then allows a 5% discount on the billing amount. Output billing amount, discount
and amount after discount
16. This pseudo code algorithm inputs two non-zero numbers and a sign, and then performs the
calculation shown by the sign. An input of zero for the first number terminates the process.

(a) Complete the trace table for the input data: 5, 7, +, 6, 2, –, 4, 3, *, 7, 8, ?, 0, 0, /

17. Explain the difference between the programming concepts of sequence and selection. Include
an example of a programming statement for each concept in your explanation.
18. Give an example of a pseudo code statement or statements to perform each of the following
functions.
Conditional statement:
…………………………………………………………………………………………………………………………….. [3]
19. Identify two different conditional statements that you can use when writing pseudo code.
1 ……………………………………………………………………………………………………………….
2 ………………………………………………………………………………………………………………. [2]
20. Identify two different selection statements that you can use when writing pseudo code.

1 ……………………………………………………………………………………………………………….

2 ………………………………………………………………………………………………………………. [2]

21. 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]
22. Give an example of a conditional statement using pseudo code. [2]
23. Describe the purpose of a conditional statement. [2]
2

(a) Name the type of statement demonstrated by the use of IF … THEN … ELSE … ENDIF [1]
b) Re-write the pseudo code algorithm using a CASE statement. [4]

You might also like