Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
Question 14

A drone delivery service is loading packages onto a cargo drone. The drone has a maximum payload capacity. Several packages of varying weights will be loaded one by one until the payload capacity is reached or exceeded.

Write a program in Python, pseudocode, or any high-level programming language that tracks the remaining payload capacity of the drone as packages are loaded.

The program must:

  • Ask the user to enter the maximum payload capacity of the drone
  • Prompt the user to enter the weight of a package being loaded
  • Subtract the package weight from the remaining payload capacity:
    • If the remaining capacity is greater than 0, output how much capacity is still available and repeat until the remaining capacity is 0 or less
    • If the remaining capacity is exactly 0, output the message Capacity reached
    • If the remaining capacity is less than 0, output the message Overloaded by followed by the excess weight (the absolute difference between the remaining capacity 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