Skip to content
MathsGenie logo
Open app

Course home

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

Subprograms

EasyMedium
123456789101112131415161718192021222324252627282930
Question 14

Read the following subprogram written in pseudocode:

function processTemperatures(readings)
    total = 0
    count = 0
    for temp in readings
        if temp > 0 then
            total = total + temp
            count = count + 1
        endif
    endfor

    if count > 0 then
        result = total / count
        return result
    else
        return -1
    endif
endfunction

Describe the purpose of the processTemperatures subprogram.

[2]

Subprograms Questions

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