mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
Added Celsius to Fahrenheit Conversion formula
This commit is contained in:
11
mathgenerator/funcs/celsiustofahrenheit.py
Normal file
11
mathgenerator/funcs/celsiustofahrenheit.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from .__init__ import *
|
||||||
|
from ..__init__ import Generator
|
||||||
|
|
||||||
|
def celsiustofahrenheit(maxTemp=100):
|
||||||
|
celsius = random.randint(-50, maxTemp)
|
||||||
|
fahrenheit = (celsius * (9/5)) +32
|
||||||
|
problem = "Convert", str(celsius), "deg Celsius to degrees Fahrenheit ="
|
||||||
|
solution = str(fahrenheit)
|
||||||
|
return problem, solution
|
||||||
|
|
||||||
|
celsiustofahrenheit = Generator("Celsius To Fahrenheit", 81, "(C +(9/5))+32=", "F", celsiustofahrenheit)
|
||||||
@@ -116,3 +116,4 @@ intMatrix22determinant = Generator("Determinant to 2x2 Matrix", 77, "Det([[a,b],
|
|||||||
compoundInterest = Generator("Compound Interest", 78, "Compound interest for a principle amount of p dollars, r% rate of interest and for a time period of t years with n times compounded annually is = ", "A dollars", compoundInterestFunc)
|
compoundInterest = Generator("Compound Interest", 78, "Compound interest for a principle amount of p dollars, r% rate of interest and for a time period of t years with n times compounded annually is = ", "A dollars", compoundInterestFunc)
|
||||||
decimalToHexadeci = Generator("Decimal to Hexadecimal", 79,"Binary of a=", "b", deciToHexaFunc)
|
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)
|
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", celsiustofahrenheit)
|
||||||
|
|||||||
Reference in New Issue
Block a user