curved surface area cylinder fix

This commit is contained in:
lukew3
2020-10-21 14:31:17 -04:00
parent 1027ad6381
commit 55fb0a18f6
5 changed files with 109 additions and 106 deletions

View File

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

View File

@@ -1,13 +0,0 @@
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)

View File

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