Question
Task: Let's build a program that is a calculator using JavaScript. The user inputs a number, an operator, and a second number and they will
Task: Let's build a program that is a calculator using JavaScript. The user inputs a number, an operator, and a second number and they will get the answer to the math problem.
1. Prompt the user to enter a number. Check to see if the input is a number. If not, end the program.
2. Prompt the user to enter an operator. Check to see if the input is an operator. If not, end the program.
3. Prompt the user to enter a second number. Check to see if the input is a number. If not, end the program.
4. Do the math (number1 operator number2) and output the answer.
5. If the user does not do something correctly, make sure you let them know what they did wrong.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started