Question 5
Edexcel Computer Science Specimen Paper 2GCSE15 marks
On the specification
- 6.6 Subprograms6.5 Operators
Question text
5 Students are collecting data about the amount of water needed to fill different sized The formula to calculate the volume of a cone is: 12 V = πr h 3 • V is volume • π is the constant Pi • r is the radius of the base of the cone • h is the height of the cone. A program and subprogram have been started to carry out the calculation. Open file Q05. Amend the program and subprogram to meet the following requirements: • the subprogram must work for any values of radius and height passed as parameters. You can assume values passed to the subprogram will always be numbers. No validation is required • the subprogram must calculate the volume based on the input parameters • the main program must print the volume, formatted to show three decimal places (e.g. 16.135). Do not add any additional functionality. Save your amended code as Q05FINISHED.py (Total for Question 5 = 15 marks)