Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
Question 37

A local agricultural cooperative is filling a grain silo to a specific target weight from successive truck deliveries. Several truckloads of grain will be added until the target capacity is met or exceeded.

Write a program in Python, pseudocode, or any high-level programming language that tracks the total weight of grain added towards the target capacity.

The program must:

  • Ask the user to enter the target weight of grain (in tonnes)
  • Prompt the driver of each delivery truck to enter the weight of grain (in tonnes) they are delivering
  • Subtract the delivered weight from the remaining portion of the target weight:
    • If the weight left to deliver is greater than 0, output how much weight is still required and repeat the loop until the weight left to deliver is 0 or less
    • If the weight left to deliver is exactly 0, output the message Silo filled
    • If the weight left to deliver is less than 0, output the message Overflow by followed by the excess weight delivered (the difference between the remaining weight 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