mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
Merge branch 'master' of https://github.com/Todarith/mathgenerator
This commit is contained in:
@@ -80,3 +80,4 @@ from .matrixInversion import *
|
||||
from .sectorAreaFunc import*
|
||||
from .meanMedianFunc import*
|
||||
from .determinantToMatrix22 import *
|
||||
from .deciToHexaFunc import *
|
||||
|
||||
11
mathgenerator/funcs/compoundInterestFunc.py
Normal file
11
mathgenerator/funcs/compoundInterestFunc.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from .__init__ import *
|
||||
|
||||
def compoundInterestFunc(maxPrinciple = 10000, maxRate = 10, maxTime = 10, maxPeriod = ):
|
||||
p = random.randint(100, maxPrinciple)
|
||||
r = random.randint(1, maxRate)
|
||||
t = random.randint(1, maxTime)
|
||||
n = random.randint(1, maxPeriod)
|
||||
A = p * ((1 + (r/(100*n))**(n*t)))
|
||||
problem = "Compound Interest for a principle amount of " + str(p) + " dollars, " + str(r) + "% rate of interest and for a time period of " + str(t) + " compounded monthly is = "
|
||||
solution = round(A, 2)
|
||||
return problem, solution
|
||||
10
mathgenerator/funcs/deciToHexaFunc.py
Normal file
10
mathgenerator/funcs/deciToHexaFunc.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from .__init__ import *
|
||||
|
||||
|
||||
def deciToHexaFunc(max_dec=1000):
|
||||
a = random.randint(0, max_dec)
|
||||
b = hex(a)
|
||||
problem = "Binary of " + str(a) + "="
|
||||
solution = str(b)
|
||||
|
||||
return problem, solution
|
||||
Reference in New Issue
Block a user