Best Calculator Programming

Job ID: 32863879

Budget: $10 – $100 USD

Connect the UI to the script so that every time there is a change in the input field or to the Degree Mode checkbox, the calculation will trigger and either display an answer or an error message. Fortunately, I am not expecting you to build the best calculator ever(yet) so we don`t need to support all the possible math calculations in the world. Simple stuff such as 5+3, (3-1)*4-32+8*4, 3sin(97-51), and so on will do the trick for now. We will provide the rest of the required functionality later.
Task 1 will require you to implement a calculator that is capable of correctly calculating the following mathematical functions.

Addition, subtraction, multiplication, division, sin, cos.

Task 2:
Since you are creating the best calculator in the world, of course, we need to support both Radian and Degree mode for trigonometric functions of Sin and Cos. By default, Degree mode will be unticked and hence we will be in Radian mode. As soon as Degree mode is ticked, we will switch to degree mode and the calculations of sin and cos will be done in degree mode.

*Radian to Degree conversion.
You can convert radians to degrees by multiplying the argument of trigonometric functions by 180/pi. For example,

sin(3) in radian mode is the same as sin(3*(180/pi)) in degree mode.
cos(3.11*pi) in radian mode is the same as cos(3.11*pi*(180/pi)) in degree mode.

Test Cases - TODO
5-6*4+(12/3) = -15
sin(32-cos(16)) = 0.999577...(Radian Mode)
cos(pi)/sin(11.5-pi) = -1.142266...(Radian Mode)
5(sin(3)-cos(pi*15))/4 = -0.785099...(Degree Mode)
Related categories: JavaScript Scientific Research Mathematics