Skip to content

Course home

Subprograms

Subprograms

EasyMedium
123456789101112131415161718192021222324252627282930
Question 10

A programmer is writing a software system to monitor weather station data. They have written the following Python program containing a subprogram to convert temperatures from Fahrenheit to Celsius.

def convertToCelsius(fahrenheit):
    celsius = (fahrenheit - 32) * 5 / 9
    return celsius

# Main program
currentTemp = 98.6
convertedTemp = convertToCelsius(currentTemp)
print("The temperature in Celsius is " + str(convertedTemp))

Identify the name of the variable in the main program that receives the value calculated and returned by the subprogram.

[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