Skip to content
MathsGenie logo
Open app

Course home

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

Subprograms

EasyMedium
123456789101112131415161718192021222324252627282930
Question 13

An algorithm is shown below with line numbers.

01 def calculate_delivery(weight, distance):
02     base_fee = 5.00
03     if weight > 10:
04         base_fee = base_fee + 10.00
05     total = base_fee + (distance * 0.5)
06     return total
07
08 item_weight = float(input("Enter weight: "))
09 item_dist = float(input("Enter distance: "))
10 cost = calculate_delivery(item_weight, item_dist)
11 print("Total cost: " + str(cost))

Identify the line number where a subprogram definition starts.

[1]

Subprograms Questions

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