3
0/15

A local crafting studio is organizing a DIY Candle Making Workshop.

The table shows the quantity of materials needed for each adult and each junior attending the event.

Table 1: Material requirements per person

MaterialAdultJunior
Soy Wax180 g100 g
Fragrance Oil12 ml5 ml
Wicks2.0 wicks1.0 wick

An algorithm is used to determine how much soy wax, how much fragrance oil, and how many wicks to order for an event based on attendance numbers.

  • Soy Wax is ordered in whole bags. A bag contains 1000 g. A partial bag cannot be ordered.
  • Fragrance Oil is ordered by the bottle. A bottle contains 50 ml. If the total volume needed is less than or equal to 50 ml, then exactly 1 bottle must be ordered. Otherwise, the number of bottles is rounded up to the nearest whole bottle.
  • Wicks are ordered in packs. A pack contains 12 wicks. If the total number of wicks needed is less than or equal to 12, then exactly 1 pack must be ordered. Otherwise, the number of packs is rounded up to the nearest whole pack.

Flowchart of the algorithm

Flowchart showing the step-by-step logic to calculate the bags of wax, bottles of fragrance oil, and packs of wicks 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 material quantities per person and package 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