Merge pull request #295 from Souvikdeb2612/master

Added curved surface area of cylinder function
This commit is contained in:
Luke Weiler
2020-10-21 14:27:30 -04:00
committed by GitHub
2 changed files with 14 additions and 0 deletions

View File

@@ -99,3 +99,4 @@ from .bcd_to_decimal import *
from .complex_to_polar import * from .complex_to_polar import *
from .set_operation import * from .set_operation import *
from .base_conversion import * from .base_conversion import *
from .curvedSurfaceAreaCylinderFunc import *

View File

@@ -0,0 +1,13 @@
from .__init__ import *
def curvedSurfaceAreaCylinderFunc(maxRadius = 49, maxHeight=99):
r = random.randint(1, maxRadius)
h = random.randint(1, maxHeight)
problem = f"What is Curved surface area of a cylinder of radius, {r} and height, {h}?"
csa = float(2*math.pi*r*h)
formatted_float = "{:.5f}".format(csa)
solution = f"CSA of cylinder = {formatted_float}%"
return problem, solution
curvedSurfaceAreaCylinder = Generator("Curved surface area of a cylinder", 95,"What is CSA of a cylinder of radius, r and height, h?","csa of cylinder",curvedSurfaceAreaCylinderFunc)