Question 8
Edexcel Computer Science June 2018 Paper 2GCSE9 marks
On the specification
- 1.2 Algorithms6.2 Program constructs6.4 Input and output
Question text
8 P-Cubed wants to know the weight of the heaviest item and the weight of the lightest item. An operator enters weights for each item. The operator enters 0 when finished. The algorithm will: • Take the weights of an item from the user. • Count the number of items. • Tell the user if they have entered an invalid weight. • Output the weight of the heaviest item. • Output the weight of the lightest item. Here is a sample output. Write an algorithm to meet the requirements. Use pseudo-code or a programming language with which you are familiar. (9)