Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
- scalene (the 3 different sides)
- equilateral (the 3 equal sides)
- isosceles (only 2 equal sides).
You should write Boolean expressions for the following Boolean variables and use them in your program:
- TheThreePositive
- formTriangle
- scalene
- equilateral
- isosceles
** In case of not being all positive the output is the message: All 3 values are not positive **
OUTPUT EXAMPLES :
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started