Question: Write a JavaScript code to do the following: Displays a menu in a prompt to ask the user to choose between different menu items The

Write a JavaScript code to do the following:

  • Displays a menu in a prompt to ask the user to choose between different menu items
  • The choices as follow:
    • Choice 0 exists with an alert message Bye
    • Choice 1 prompts the user to input a number and then it alerts the result of that number to the power of 2
    • Choice 2 - prompts the user to input a number and then it alerts the result of that numbers square root
    • Choice 3 prompts the user to input a number and then it alerts the floor of that number
    • Invalid choices alerts Invalid choice and then displays the menu again

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!