Terence Tao loves Mathematics. So he decided to create one special calculator, which behaves a little
different to normal calculators.
Tao is now on a quest to create this special calculator. He needs YOU to help him code functionalities in the back-end though. Go to the src/app.js
file and complete all the unfinished code to satiate her sweet tooth.
Before starting have a look through the link below - to get an idea as how to approach the lab.
Simple Addition bores Tao, so he decided to revert it's role, by subtracting when addition method is called. Create a function specialAddition()
that takes numberOne, numberTwo
as arguments, and returns
the addition of those two numbers.
Tao loves division, so he kept everything simple and normal - so division works as division should work!
Create a function simpleDivision()
that takes numberOne, numberTwo
as arguments, and returns
the division of those two numbers.
Tao just wanted the special addition and simple division methods for his special calculator. So now he wants to create his calculator in such a way, that as soon as any of the two operations are called, the
respective operation is done - in the way he have defined those operations.
Create a function specialCalculator()
that takes numberOne, numberTwo, operation
as an argument, and returns the respective output from the respective operation called.
Try not to use if-else -> for implementing this special calculator.
Happy Coding Kalvium ❤️