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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 17RQ
icon
Related questions
Question

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 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,