Question: Write a program using Java that reads 3 positive integer values (the program validates the 3 values are positive) and determines if they form a

Write a program using Java that reads 3 positive integer values (the program validates the 3 values are positive) and determines if they form a triangle and what kind of triangle:

  1. scalene (the 3 different sides)
  2. equilateral (the 3 equal sides)
  3. isosceles (only 2 equal sides).

You should write Boolean expressions for the following Boolean variables and use them in your program:

  1. TheThreePositive
  2. formTriangle
  3. scalene
  4. equilateral
  5. isosceles

** In case of not being all positive the output is the message: All 3 values are not positive **

OUTPUT EXAMPLES :

Write a program using Java that reads 3 positive integer values (the

Output Examples: Enter first integer ===> 9 Enter first integer ===> 3 Enter second integer ===> 7 Enter second integer ===> 6 Enter third integer ===> 8 Enter third integer ===> 2 They form a scalene triangle They don't form a triangle Enter first integer ===> 9 Enter first integer ===> 9 Enter second integer ===> 7 Enter second integer ===> 9 Enter third integer ===> 7 Enter third integer ===> 9 They form an isosceles triangle They form an equilateral 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 Databases Questions!