Skip to content
MathsGenie logo
Open app

Course home

  1. IGCSE
  2. Computer Science Edexcel
  3. Question bank

Subprograms

EasyMedium
123456789101112131415161718192021222324252627282930
Question 18

Consider the following Python algorithm:

def calculate_tax(amount, region):
    if region == "UK":
        return amount * 0.20
    return amount * 0.15

subtotal = float(input("Enter subtotal: "))
tax_amount = calculate_tax(subtotal, "UK")
total = subtotal + tax_amount
print("Total is: " + str(total))

Identify the name of a user-defined subprogram used in this algorithm.

[1]

Subprograms Questions

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