Skip to content

Course home

Subprograms

Subprograms

EasyMedium
123456789101112131415161718192021222324252627282930
Question 15

A program is written to calculate the tax on a shopping item.

1 FUNCTION calculateTax(price)
2 BEGIN FUNCTION
3     IF price > 100 THEN
4         tax = price * 0.20
5     ELSE
6         tax = price * 0.05
7     END IF
8     RETURN tax
9 END FUNCTION
10
11 SEND "Enter the item price: " TO DISPLAY
12 RECEIVE userPrice FROM (REAL) KEYBOARD
13 SET finalTax TO calculateTax(userPrice)
14 SEND ("Tax to pay: " & finalTax) TO DISPLAY

Identify the name of a parameter used in this pseudocode.

[1]
Markscheme

Subprograms Questions

  1. IGCSE
  2. /Computer Science
  3. /Subprograms

33 exam-style questions on Edexcel IGCSE Computer Science Subprograms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank