Answered step by step
Verified Expert Solution
Link Copied!

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:

  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 :

image text in transcribed

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

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

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions

Question

2. Do you find change a. invigorating? b. stressful? _______

Answered: 1 week ago

Question

How was their resistance overcome?

Answered: 1 week ago