Biweekly Coding Challenge 3: With the Help of Felix... You can get your math homework done
link to Repl Project!
- Felix
- Basic Calculator
a. Addition, Subtraction, Multiplication and Division - Scientific Calculator
a. Trig Functions
b. Inverse of Trig Functions
c. Hyperbolic Trig Functions
d. Inverse of Hyperbolic Trig Functions
e. Pi and Euler's Number
f. Log and Natural Lot
g. Factorial
h. Absolute Value
i. Negation
j. Floor and Ceiling
k. Rounding - Linear Calculator
a. Accepting linear equations/expressions
b. Outputing Standard Form and Y-intercept Form
c. Outputing Slope and y-intercept
d. Accepting X values and outputting Y values
e. Accepting Y values and outputting X values - Quadratic Calculator
a. Accepting Quadratic expressions
b. Outputting Standard Form and Vertex Form
c. Outputting Axis of Symetry
d. Outputting Vertex, Determinant, and Min or Max values
e. Accepting X values and outputting Y values
My Advance Calculater has 4 Different Calculators in it and I know this is rushed, but this is where you understand how to use them all.
My Advance Calculator has 4 Different types of Calculators inside of it...
- Basic
- Scientific
- Linear
- Quadratic
In order to be able to use each of them, you need to know their tags...
The tag is the string you put infront of your math to tell Felix what Calculator to use
If you have ever used Discord Bots, you sort of understand where I'm coming from.
Now... Here are the Tags: - Basic:
basic
a.Example: basic (8 - 4) * 10
b.Example: basic 3 + 3 * 10
- Scientific:
sci
a.Example: sci cos(pi) + sin(tau)
b.Example: sci (8 + 4)/10
c. `Example: sci root(4, 256) --> This means the Fourth Root of 256 - Linear:
linear
a.Example: linear 3x + 2y = 10
b.Example: linear y = 10x - 30
c.Example: linear 0.5y - 10x
- Quadratic:
quad
a.Example: quad 3x^2 + 10x - 15 = 0
b.Example: quad 3(x - 19)^2 - 10
Now, the Scientific Calculater is the default setting so if you want to use that one, you actually don't need a tag infront of it... But for the rest, you do.
However, If you want to change the default calculator... What you do is use the tag default
and then type the tag of the calculator you want to switch default to.
Example: default quad
Example: default linear
Example: default basic
Keep in mind that you have to be very careful how you input your Tags and your Math so that Felix can read it. Felix already has a lot in his hads reading your math and helping you with your Math homework. The least you could do is be considerate and make it easier on him to read.
- Basic Calculator: Make sure what you give it is what you would give a basic calculator... This calculator also accepts the use of parentheses and exponents. But beyond that it's still a Basic Calculator.
- Linear Calculator: Make sure what you give it is a linear equation. Meaning It has the variables y and x and that none of them are raised to some obscure number. If I graph what you give it, it should result in a stright line. Also don't try subtracting a negative number. (Example:
y - -x
). Symplify that or else you mess up Felix's innocent self. Once you start using the Calculator, the instructions I placed inside there should suffice as guidence. - Quadratic Calculator: Make sure what you give is a quadratic equation. Unlike the Linear Calculator, I only accept the variable x. I don't want to see y anywhere. Don't even act cool and use
f(x)
. Because that isn't cool when you get an error report. All the other rules above for the Linear Calculator also apply. Here is what my Quadratic Calculator accepts as input.
a.x^2
b.x^2 + 3x = 0
c.x^2 + 3x + 4
d.x^2 + 3x + 4 = 10
e.3x^2 + 3x + 10x - 4 = 50 - 2x^2 + x
(Notice how there is noy
in there... That's literally all I want... No other variables)
My Scientific Calculator is my most Advanced and Complex of all the Calculators I built here.
While all of the others took no more than a day and a half to build... This one took a whole 7 days... And as such deserves a deeper description thatn the others...
My Scientific Calculator has 12 Trigonometric Functions. Those include:
- The Three main
sin
,cos
,tan
- Their inverses
asin
,acos
,atan
- The Hyperbolics
sinh
,cosh
,tanh
- And Their inverses
asinh
,acosh
,atanh
The syntax for these trig functions is as such:
Example: cos(pi)
Example: sin(tau)
Example: tan(10 + 10 - 20)
My Scientific Calculator accepts Degrees and Radians... But you have to set it up youself.
The Default Angle Setting is Radians. You can change that using the angle
tag and following up with the name of the angle setting.
This is very very similar to the how you use the default
tag.
Example: angle degrees
Example: angle radians
I have a few Constants in use in my Scientific Calculator... Those include
pi
, e
, tau
As for how to use them... It's super easy...
Example: pi + tau - e^2 - cos(pi)
My Calculator accepts 8 operators... Those being +
, -
, *
, /
.
It also Accepts factorial !
, percentage %
, and exponents in two forms ^
and **
(for those of us programmers).
Now, for the Sake of You programmers out there... I know y'all are sad to see me use the %
for percentage... Don't worry, You can still acces modules. All you've got to do is use mod
.
Example: 3 mod 2
--> NO PARENTHESES. mod
is an operator not a function. Treat it like you would the plus and minus sign.
I'm really really sorry that this ended up being supper long and tedius. However, I take this very seriously and I would want to make sure you understand exactly how to use this Calcualator
I promice you this is the last one...
I have several Functions in my Scientific Calculator. Those include
One parameter: ln
, sqrt
, cbrt
, abs
, percent
, factorial
ceil
, floor
, negate
, trunc
Two parameters: root
, log
, round
All of these functions work very similarly to the Trigonometric Functions above.
Now, I will more deeply explain these...
abs
: returns the absolute value of the number ->abs(-10)
percent
: assumes the number is a percentage and returns the decimal version (Example percent(3)
is 0.03) (This is actually the function I used to operate the %
operator
factorial
: returns the factorial of a number (This was actually the function I used to operate the !
operator
ln
: returns the natural log of the number ln(100)
sqrt
and cbrt
: returns the square root and cube root respectively
ceil
and floor
: returns the ceiling and the floor of a number
negate
: returns the opposite of a number (Example: negate(3)
results in -3 while negate(-3)
results in 3)
trunc
: removes everything after the decimal point (Example: trunc(3.121)
results in just 3)
root
: if given two arguments, returns the nth root of the second value (Example: root(4, 1024)
is the fourth root of 1024 or 5 since 4 to the fifth power is 1024). If given one argument, return the square root.
log
: if given two arguments, returns the log of the second argument with a base of the first (Example: log(2, 1024)
is 10 because 2 is the base and 1024 is the value in question. If given one argument, returns the logritim with default base 10.
round
: if given tow arguments, returns the first argument rounded to the second number's place. (Example: round(3.141592, 3)
is 3.141. If given one argument, returns the number rounded to the nearest whole number.
Thank you Very Much for reading this far into my ReadMe file. Or Skimming, or Skipping. However, it doesn't matter. I hope you found this helpful and I really hope you enjoyed Felix and I's Advanced Calculatro.