Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
Question 44

A school club is raising money to buy new equipment. Instead of one person paying, several members will contribute different amounts towards a fundraising target.

Write a Python program that asks members how much they are contributing towards the target and works out when the target is reached. Each member can contribute a different amount.

The program should:

  • Get the user to enter the initial fundraising target.
  • Get a member to enter how much they are contributing.
  • Subtract the contribution from the remaining target amount:
    • If the amount remaining is more than 0, output how much is still needed to reach the target, and repeat this process until the remaining target is 0 or less.
    • If the amount remaining is exactly 0, output the message Target achieved.
    • If the amount remaining is less than 0, output the message Surplus is followed by the difference (as a positive number) showing by how much they exceeded the target.

You should use indentation as appropriate, meaningful variable name(s), and Python 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