/calculator-js

Created with StackBlitz ⚡️

Primary LanguageJavaScript

Logo-nav

Kalvium Lab | Special Calculator

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 his sweet tooth.

How to approach a lab:

Before starting have a look through the link below - to get an idea as how to approach the lab.

How to approach a lab

Progression 1: Special Addition!

Simple Addition bores Tao, so he decided to revert it's role, by subtracting when addition method is called. Create a function specialAddition() - (make sure you name this function as it is) that takes numberOne, numberTwo as arguments, and returns the addition of those two numbers.

Progression 2: Simple Division!

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.

Progression 3: Special Calculator!

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.

Challenge : If-Else or Something Else!

Try not to use if-else -> for implementing this special calculator.

Happy Coding Kalvium ❤️