Skip to content

Course home

Structured programming and subroutines (procedures and functions)

Structured programming and subroutines (procedures and functions)

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
Question 32

A programmer is developing a game scoring system. The following pseudocode contains a procedure and two functions used to process score adjustments.

procedure CalculateScore(a, b, c)
    val = a * b
    print(AdjustScore(val, c))
endprocedure

function AdjustScore(p, q)
    total = p - q
    if total > 15 then
        total = total + ExtraBonus(p)
    endif
    return total
endfunction

function ExtraBonus(r)
    if r > 20 then
        return 10
    else
        return 4
    endif
endfunction

State the value that will be printed when the procedure CalculateScore is called with the arguments 6, 4, and 5 for the parameters a, b, and c respectively.

[1]
Markscheme

Structured programming and subroutines (procedures and functions) Questions

  1. GCSE
  2. /Computer Science
  3. /Structured programming and subroutines (procedures and functions)

131 exam-style questions on AQA GCSE Computer Science Structured programming and subroutines (procedures and functions). Each one has a worked solution and a mark scheme showing where the marks go.

Question bank