From 630032fcddc117f9f02ab9a4b302dbf69207577c Mon Sep 17 00:00:00 2001 From: Metropass Date: Mon, 19 Oct 2020 15:49:11 -0400 Subject: [PATCH] Added DecimalToOctal, and DecimalToRomanNumerals --- README.md | 2 ++ mathgenerator/funcs/__init__.py | 1 + mathgenerator/mathgen.py | 2 ++ 3 files changed, 5 insertions(+) diff --git a/README.md b/README.md index f2d81dc..5b9bcff 100644 --- a/README.md +++ b/README.md @@ -104,3 +104,5 @@ problem, solution = mathgen.genById(0) | 65 | Geometric Progression | For the given GP [4, 16, 64, 256, 1024, 4096] ,Find the value of a,common ratio,8th term value, sum upto 7th term | The value of a is 4, common ratio is 4 , 8th term is 65536 , sum upto 7th term is 21844.0 | geometricprogression | | 66 | Geometric Mean of N Numbers | Geometric mean of 3 numbers 81 , 35 and 99 = | (81*35*99)^(1/3) = 65.47307713912309 | geometricMean | | 67 | Harmonic Mean of N Numbers | Harmonic mean of 2 numbers 99 and 25 = | 2/((1/99) + (1/25)) = 39.91935483870967 | harmonicMean | +| 82 | Decimal to Octal Conversion | What's the octal representation of 98? | 0o142 | decimalToOctalFunc | +| 83 | Decimal to Roman Numerals | What's the Roman Numeral representation of 3805? | MMMDCCCV | decimalToRomanNumeralsFunc diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 83702eb..25e3968 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -84,3 +84,4 @@ from .compoundInterestFunc import * from .deciToHexaFunc import * from .percentageFunc import * from .celsiustofahrenheit import * +from .decimaltoOctalFunc import * diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index f679b0c..8a26906 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -268,3 +268,5 @@ decimalToHexadeci = Generator("Decimal to Hexadecimal", 79, "Binary of a=", 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) +decimalToOctal = Generator("Converts decimal to octal", 82, "What's the octal representation of 98?", "0o142", decimalToOctalFunc) +decimalToRomanNumerals = Generator("Converts decimal to Roman Numerals", 83, "Convert 20 into Roman Numerals", "XX", decimalToRomanNumeralsFunc)