Skip to content
MathsGenie logo
Open app

Course home

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

Subprograms

EasyMedium
123456789101112131415161718192021222324252627282930
Question 9

A programmer has written the following subprogram to process text inputs.

function processText(phrase)
    total = 0
    for i = 0 to length(phrase) - 1
        character = subString(phrase, i, 1)
        if character >= "A" and character <= "Z" then
            total = total + 1
        endif
    next i
    return total
endfunction

State the purpose of this subprogram.

[2]

Subprograms Questions

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