Question: Given the three sides of a triangle side 1 , side 2 and side 3 , write a Java program that first determines whether these

Given the three sides of a triangle side1, side 2 and side3, write a Java program that first determines whether these values represent a valid triangle. This can be determined as follows:
side 1+ side 2> side 3 AND
side 2+ side 3> side 1 AND
side 3+ side 1> side 2
If the three sides represent a valid triangle, the program should then compute the perimeter and area of the triangle using the formulas given below:
Perimeter = side 1+ side 2+ side 3
Area =s**(s-side1)**(s-side2)**(s-side3)2 where,
s=side1+side2+side32.0
Programming requirements
You must read the values of the three sides from the input.
You must print all the three sides, perimeter and area, with appropriate captions.
Hint: To compute the square root, use the mathematical function Math.sqrt (x); for example, area = Math.sqrt side1
 Given the three sides of a triangle side1, side 2 and

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 Databases Questions!