Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
Question 30

A craft brewery is filling a fermentation vessel to a specific target volume. Brewers add starter liquid in batches of varying sizes until the vessel's target volume is met.

Write a program in Python or exam-style pseudocode that asks users to enter the target volume and tracks when the target is reached.

The program should:

  • Prompt the user to enter the initial total target volume (in litres).
  • Repeatedly prompt the operator to enter the volume of a batch being added.
  • Subtract each batch volume from the remaining volume needed:
    • If the remaining volume needed to reach the target is more than 0, output how much is left to add and repeat the process.
    • If the remaining volume needed is exactly 0, output the message Vessel full.
    • If the remaining volume needed is less than 0, output the message Spillway overflow is followed by the positive difference (how much they went over the target volume).

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