2
0/15

An environmental charity is organizing a community garden planting event.

The table below shows the quantity of supplies needed for each volunteer adult and each junior helper attending the event.

Table 1: Gardening supplies required per person

SupplyAdultJunior
Seed Compost4.5 litres1.5 litres
Biodegradable Pots12 pots4 pots
Sapling Stakes3.0 stakes1.0 stake

An algorithm is used to determine how much seed compost, how many biodegradable pots, and how many sapling stakes to order for an event based on attendance numbers.

  • Seed Compost is ordered in whole bags. A bag contains 20 litres of compost. A partial bag cannot be ordered.
  • Biodegradable Pots are ordered in packs. A pack contains 50 pots. If the total number of pots needed is less than or equal to 50, then exactly 1 pack must be ordered. Otherwise, the number of packs is rounded up to the nearest whole pack.
  • Sapling Stakes are ordered in bundles. A bundle contains 12 stakes. If the total number of stakes needed is less than or equal to 12, then exactly 1 bundle must be ordered. Otherwise, the number of bundles is rounded up to the nearest whole bundle.

Flowchart of the algorithm

Flowchart showing the step-by-step logic to calculate the bags of compost, packs of pots, and bundles of stakes required based on adult and junior attendance.

Write Python code to implement the algorithm shown in the flowchart.

Your code should:

  • Import and use any necessary standard libraries (such as math).
  • Use constants for the supply quantities per person and packaging specifications.
  • Prompt the user to input the number of adults and juniors.
  • Implement all the calculations and decisions matching the logic in the flowchart.
  • Display descriptive messages to make outputs easy for the user to understand.
  • Use comment lines, indentation, and meaningful variable names to ensure code readability.
[15]

Develop code Questions

Practise Edexcel GCSE Computer Science Develop code with exam-style questions for GCSE Computer Science. 57 questions covering Decomposition and abstraction to solve problems, Read, write, analyse and refine programs, Converting algorithms into programs, Techniques for readable, maintainable code, Identifying and correcting program errors, and Evaluating program fitness and efficiency, matched to the Edexcel GCSE Computer Science (1CP2) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Develop code Questions

  1. GCSE
  2. /Computer Science
  3. /Develop code