Question: Rasika had an assignment from her mathematics class to identify the type of a triangle using the length of its side. Using your Java coding

Rasika had an assignment from her mathematics class to identify the type of a triangle using the length of its side. Using your Java coding skills, help her to identify and display the triangle name.

If all the three sides of the triangle are different then it is a" are the sides of Scalene Triangle"

If any two sides of the triangle are equal then it is an" are the sides of Isosceles Triangle"

If all the three sides of the triangle are equal then it is an" are the sides of Equilateral Triangle"

Note:

The length of any side must be greater than 0, otherwise, print " is an Invalid Length" and terminate.

Sample Input 1:

5

5

5

Sample Output 1:

5, 5, 5 are the sides of Equilateral Triangle

Sample Input 2:

5

0

Sample Output 2:

0 is an Invalid Length

Sample Input 3:

10

15

10

Sample Output 3:

10, 15, 10 are the sides of Isosceles Triangle

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!