Make a function that determines if a triangle is equilateral, scalene, or isosceles given the length of the sides of the triangle. In the main function, prompt the user three times to input three numbers using the prompt()function. These three numbers are the measurements of the length of the sides of the triangle. Make sure that the user is typing numbers. Use the isNaN() function to check. To implement this, you can declare three variables and the value for each variable is a prompt for the user. Refer to the sample below: var a = prompt(); var b = prompt(); var c = prompt(); Create a function determineTriangle(a, b, c) that accepts the three numbers from the user as input. The output of the determineTriangle(a, b, c) function is the type of the triangle. Use if..else statements for this feature. If all three sides of the triangle are equal, then output “The triangle is EQUILATERAL.” If only two sides are equal, output “The triangle is ISOSCELES,” else, output “The triangle is SCALENE.” Print the output inside the determineTriangle(a, b, c) function using the window.alert() function. Sample input: 3 4 5 Output: The triangle is SCALENE
Make a function that determines if a triangle is equilateral, scalene, or isosceles given the length of the sides of the triangle.
In the main function, prompt the user three times to input three numbers using the prompt()function. These three numbers are the measurements of the length of the sides of the triangle. Make sure that the user is typing numbers. Use the isNaN() function to check. To implement this, you can declare three variables and the value for each variable is a prompt for the user. Refer to the sample below:
var a = prompt();
var b = prompt();
var c = prompt();
Create a function determineTriangle(a, b, c) that accepts the three numbers from the user as input.
The output of the determineTriangle(a, b, c) function is the type of the triangle. Use if..else statements for this feature. If all three sides of the triangle are equal, then output “The triangle is EQUILATERAL.” If only two sides are equal, output “The triangle is ISOSCELES,” else, output “The triangle is SCALENE.” Print the output inside the determineTriangle(a, b, c) function using the window.alert() function.
Sample input: 3 4 5 Output: The triangle is SCALENE
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images