Skip to content

Course home

Subprograms

Subprograms

EasyMedium
123456789101112131415161718192021222324252627282930
Question 16

A programmer writes the following algorithm:

def calculate_postage(weight):
    if weight < 100:
        cost = 1.50
    else:
        cost = 3.50
    return cost

parcel_weight = float(input("Enter weight: "))
final_price = calculate_postage(parcel_weight)
print("Postage cost is: " + str(final_price))

Identify the name of the user-defined function.

[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