The objective of this programming assignment is to explore Functions That Return
ID: 3810480 • Letter: T
Question
The objective of this programming assignment is to explore Functions That Return, Value and creating your own programmer-defined library. Create a programmer defined library, called calculate.js, which receives a value and computes and returns the squareroot of the value by using the predefined function Math. squareroot (x). Then create a webpage that displays an interface such as the following: The webpage will contain two programmer-defined functions. One function will take the input value that the user has entered and display the squareroot value (as shown above) using a second (programmer-defined) function which calls the squareroot function from calculate.js.Explanation / Answer
script.js:
<script type="text/javascript"> function doMath(){ var inputNum1=document.form1.input1.value; var result = Math.sqrt(inputNum1); document.form1.answer.value = result; } </script>
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.