Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions