Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
Question 54

A local youth club is running a fundraising campaign to buy new sports equipment. Several club members will donate different amounts until the campaign target is reached or exceeded.

Write a program in Python, pseudocode, or any high-level programming language that tracks donations towards the fundraising target.

The program must:

  • Ask the user to enter the total fundraising target
  • Prompt a member to enter how much they are donating toward the target
  • Subtract the donation from the remaining portion of the target:
    • If the amount left to raise is greater than 0, output how much is still left to raise and repeat until the amount left to raise is 0 or less
    • If the amount left to raise is exactly 0, output the message Target reached
    • If the amount left to raise is less than 0, output the message Exceeded by followed by the excess amount raised (the difference between the amount left and 0)

You should use meaningful variable names and correct programming syntax in your answer.

[8]
Markscheme

Programming concepts Questions

  1. GCSE
  2. /Computer Science
  3. /Programming concepts

298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank