Skip to content
MathsGenie logo
Quick links
Open app

Course home

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

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]

Subprograms Questions

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