Question: Reminder: This is a intro to java class Using Decision Statements Learning Objectives 1. More on Using Nested-If Statements 2. Using a For-loop for Counter-Control
Using Decision Statements Learning Objectives 1. More on Using Nested-If Statements 2. Using a For-loop for Counter-Control Iiteration 3. More on Generating a String by Successive Concatenation In this week's lab, you will write an interactive program that classifies a triangle based on the measures of its angles. The lengths of the sides of the triangle will be read as three integer inputs DEFINITION 1. An acute triangle is a triangle whose interior angles are all acute angles, angles less than 90 DEFINITION 2. A right triangle is a triangle with a 90 angle. DEFINITION 3. An obtuse triangle is a triangle with an obtuse angle, an angle more than 90 that is, a triangle that is neither an acute nor right triangle. DEFINITION 4 Given three numbers z, y and a, the triple does NOT satisfy the triangle inequal ity if the sum of any two numbers is less than or equal to the third. The TriangleClassifier Write a program TriangleClassifier that given three integers, determines whether they can rep- resent the lengths of the sides of a triangle and, they , classtes the triangle as acute, right or obtuse. All numeric data in this program should be integers in order to avoid round-off errors. The following is true if the three integers entered by the user satisty the triangle inequality When maz+where maz is the largest of the three values ands and s are the other sides, the triangle is an acute triangle When mar+3 where maz is the largest of the three values and s and s are the other sides, the triangle is an obtuse triangle . When s +s]=mar2. where mar is the largest of the tree values and s1 and s2 are the other sides, the triangle is a right triangle. Page 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
