Write a program which inputs 2 integers representing the
sides of a triangle, a
and b. Next, write a function which accepts the 2 sides as
parameters and
returns the hypotenuse of the triangle, c.
Use
c
2
= a
2
+ b
2
To raise a number to an exponent, us
e the built
-
in JavaScript function
Math.pow()
Let’s say you have a variable x and you want to raise it to
the 5
th
power, use
Math.pow in the following manner...
Math.pow(
x,
5
);
This will raise x to the 5
th
power.
To find the square root of a number, use t
he built
-
in JavaScript function
Math.sqrt
()
So to find the square root of x, use Math.pow
()
in the following manner...
Math.sqrt(
x
)
You must create 2 functions to
receive
credit for this assignment. Your
‘
main
’
function which is called from the button. And your
hypotenuse function.
Again, the main function calls upon the hypotenuse f
unction when it needs that
value. Get the user
’
s input, call the function, output your result.
Create your own CSS layout
No Answer is Posted For this Question
Be the First to Post Answer
write a query that returns one row for each department and the number of employees in that department. Given two tables EMPLOYEE and DEPARTMENT, where there can be multiple employees per department.
What is the worst case of AVL tree?
How do you initialize a static member of a class with return value of some function?
Write a shell program to test whether a given year is leap year or not ?
Explain what is OOPS and its concepts?
what is the certificates in biztalk?
How do i find out the number of parameters passed into function?
Can we write a method in JSP.If so how?
if heap sort contains n elements, no of comparsions required are
What is the purpose of <Trigger> element of <updatePanel> in Ajax
why applet is introduced?
if try is followed by finally block what happen to exception occured in try block
3 Answers Professional Access,