Question: function Add ( num 1 , num 2 ) { return num 1 + num 2 ; } function Subtract ( num 1 , num

function Add
(
num
1
,
num
2
)
{
return num
1
+
num
2
;
}
function Subtract
(
num
1
,
num
2
)
{
return num
1
-
num
2
;
}
function Multiply
(
num
1
,
num
2
)
{
return num
1
*
num
2
;
}
function Divide
(
num
1
,
num
2
)
{
if
(
num
2
!
=
0
)
{
return num
1
/
num
2
;
}
else
{
return "Error! Division by zero is not allowed.";
}
}
Create a Menu Based simple Calculator Program for JavaScript, using the code above. The program must have the following menu options: 1= Add 2= Subtract 3= Divide 4= Multiply 5= Quit Based on their menu choice, your program will allow your user to add, subtract, divide or multiply two numbers entered by the user. (Without using html/css, and prompt so it is node.js friendly)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!