Skip to content

Course home

Structured programming and subroutines (procedures and functions)

Structured programming and subroutines (procedures and functions)

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
Question 35

Complete the trace table using the program in Figure 1.

Figure 1

def calculateFee(baseRate, surcharge, multiplier):
    if multiplier == 0:
        return baseRate + surcharge
    else:
        return (baseRate + surcharge) * multiplier

# Main program execution
numOne = int(input("Enter base rate: "))
numTwo = int(input("Enter surcharge: "))
numThree = int(input("Enter multiplier: "))

charge = calculateFee(numOne, numTwo, numThree)

if numThree == 0:
    print("Standard rate " + str(charge))
else:
    print("Premium rate " + str(charge))
numOnenumTwonumThreeFinal output
1550
843
1022
[3]
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