Merge pull request #265 from Nitsujed/master

Added Celsius to Fahrenheit conversion
This commit is contained in:
Luke Weiler
2020-10-19 14:20:13 -04:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
from .__init__ import *
from ..__init__ import Generator
def celsiustofahrenheitFunc(maxTemp=100):
celsius = random.randint(-50, maxTemp)
fahrenheit = (celsius * (9/5)) +32
problem = "Convert", str(celsius), "degrees Celsius to degrees Fahrenheit ="
solution = str(fahrenheit)
return problem, solution
celsiustofahrenheit = Generator("Celsius To Fahrenheit", 81, "(C +(9/5))+32=", "F", celsiustofahrenheitFunc)

View File

@@ -267,3 +267,4 @@ decimalToHexadeci = Generator("Decimal to Hexadecimal", 79, "Binary of a=",
"b", deciToHexaFunc)
percentage = Generator("Percentage of a number", 80, "What is a% of b?",
"percentage", percentageFunc)
celsiustofahrenheit = Generator("Celsius To Fahrenheit", 81, "(C +(9/5))+32=", "F", celsiustofahrenheitFunc)