An agricultural enterprise is assessing the volume of grain that can be stored in different cylindrical silos.
The formula to calculate the volume of a cylinder is:
V=πr2h V = \pi r^2 h V=πr2hA program and subprogram have been started to carry out this calculation, but are incomplete.
Q05.py:# Q05.py - Unfinished program
# Do not change the existing input statements
def calculate_cylinder_volume():
# Add parameters and calculation here
pass
# Main program
radius = float(input("Enter the base radius (m): "))
height = float(input("Enter the height (m): "))
# Call the subprogram and print the formatted result
Amend the program and subprogram to meet the following requirements:
124.50 or 50.27).Do not add any additional functionality.
Save your amended code as Q05FINISHED.py
29 exam-style questions on Edexcel GCSE Computer Science Subprograms, covering Built-in and user-devised subprograms, Functions versus procedures, and Global and local variables. Each one has a worked solution and a mark scheme showing where the marks go.