Question 4
Edexcel Computer Science June 2024 Paper 2GCSE15 marks
On the specification
- 6.1 Develop code6.2 Program constructs6.5 Operators
Question text
4 P75441RA P75441RA 5 Suggested time: 25 minutes 4 A small café provides cheese rolls and crisps for community events. The table shows the amount of ingredients for each adult and each child attending an event. Ingredient Adult Child Crisps 0.75 of a bag 0.33 of a bag Cheese 40 grams 30 grams Rolls 1.5 rolls 0.5 of a roll An algorithm is used to determine how many crisps, how many rolls, and how much cheese to order for an event. Crisps are ordered by whole bags. A partial bag cannot be ordered. Rolls are ordered by pack. A pack contains 24 rolls. A partial roll or a partial pack cannot be ordered. Cheese is ordered by pack. A pack of cheese weighs 500 grams. A partial pack of cheese cannot be ordered. The flowchart shows the algorithm for calculating the amount of ingredients that must be ordered. Open file Q04.py Write the code to implement the algorithm in the flowchart. Use the library and constants provided. Use informative messages for the user. Use comments, white space and layout to make the program easier to read and understand. Do not add any additional functionality. Save your amended code as Q04FINISHED.py (Total for Question 4 = 15 marks)