Prepare a function that accepts a scalar value for the cylinder.
Question: A fuel tank has been designed as a cylinder with hemispheres as caps at both ends. The radius of the cylinder and the end cap is the same.
Create a function that will accept a scalar value for the radius of the cylinder and end caps and will accept an array for the height of the cylinder.
This function should calculate the volume of the cylinder for each height and send the resultant array of volumes back to the function call.
Q: Create a function that will accept a scalar value for the radius of the cylinder and end caps and will accept an array for the height of the cylinder.
Please do proper documentation of code and this one is complex and I don't know how to do it.