The web page must display a button. When a user clicks on the button, a prompt should show up, asking the user to enter any number. Upon entering the number, an alert should then show up with a message such as: 'The 5th power of "x" (x being the user's entered number) is "y" (with y being the result). In other words, the 5th power of a user's random entered number must be computed. How is this coded? This is the actual instruction: 'Create an HTML document and link a JavaScript file to the document in the document header. Write a function getAndShow() in the JavaScript file that will use a prompt dialog to ask the user for any number. Use the number returned by the prompt to compute the fifth power of that number and display it in a message box with a suitable message.'. There's also mention of a getAndShow() function that has to be added to the js file. Lastly, the images in the original questions are guidelines on what the code must produce.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter12: Exception Handling
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question
100%

The web page must display a button. When a user clicks on the button, a prompt should show up, asking the user to enter any number. Upon entering the number, an alert should then show up with a message such as: 'The 5th power of "x" (x being the user's entered number) is "y" (with y being the result). In other words, the 5th power of a user's random entered number must be computed. How is this coded?

This is the actual instruction: 'Create an HTML document and link a JavaScript file to the document in the document header. Write a function getAndShow() in the JavaScript file that will use a prompt dialog to ask the user for any number. Use the number returned by the prompt to compute the fifth power of that number and display it in a message box with a suitable message.'.

There's also mention of a getAndShow() function that has to be added to the js file.

Lastly, the images in the original questions are guidelines on what the code must produce.

Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning