Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
Question 36

An automated logistics drone is loaded with cargo packages. The operator must load cargo packages one by one onto the drone until the maximum payload capacity is reached or exceeded.

Write a program in Python or exam-style pseudocode that asks users to enter the maximum payload capacity and then tracks the remaining capacity as individual packages are loaded.

The program should:

  • Get the user to enter the initial maximum payload capacity.
  • Repeatedly get the operator to enter the weight of each package being loaded.
  • Subtract each package weight from the remaining capacity:
    • If the remaining capacity is more than 0, output the capacity left to load and repeat the process.
    • If the remaining capacity is exactly 0, output the message Optimal load reached.
    • If the remaining capacity is less than 0, output the message Overloaded by followed by the positive difference (how much the capacity was exceeded).

You should use meaningful variable names and correct syntax/structure 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