Sub Programs

Lesson Instructions

Watch and follow the YouTube video,  the lesson contains three parts:

Subprograms Full Lesson Video.mp4

Task - Sub Programs Activity

Task - Exam Questions - Deliberate Practice

Exam Questions - Web

Mark Scheme

Question 1

1 mark per bullet to max 4

Example Pseudocode

function newbalance(balance,cost)

    newcost = balance - cost

    return newcost

endfunction

Bullet points 3 and 4 may be combined into one line (e.g. return balance-cost). Parameters can have any sensible identifiers. Allow any sensible attempt to return a value for bullet point 4, even if this is not the correct new balance.

Question 2

1 mark per bullet

Example solution:

hours = input("Please enter number of hours played:")

minutes = input("Please enter number of minutes played:")

finalTotal = totalMins(hours, minutes)

print(finalTotal)


function totalMins(hours, minutes)

    total = hours + mins * 60

    return total

endfunction