Skip to content
MathsGenie logo
Open app

Course home

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

Subprograms

EasyMedium
123456789101112131415161718192021222324252627282930
Question 7

David has written a subprogram that processes text strings.

function manipulateString(phrase, firstIndex, secondIndex)
    result = ""
    for index = firstIndex to secondIndex
         result = result + phrase[index]
    next index
    return result
endfunction

Note: String indexing starts at 0.

State the value returned by the subprogram manipulateString when it is called with the following parameters: manipulateString("cryptography", 2, 7)

[2]

Subprograms Questions

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