Question: New Programming Techniques for Chapter 3 You are now allowed to use the following in additional to the techniques of the previous chapters: ifelse Nested
New Programming Techniques for Chapter 3
You are now allowed to use the following in additional to the techniques of the previous chapters:
ifelse
Nested ifelse
While loops (Counter and Sentinel controlled)
Float data types, casting, and formatted float printing
Increment and Decrement operators
Q3: (Possible Triangles) (25 points) Write a program that reads three non-zero, positive integer values and determines and prints whether they could represent the sides of a triangle. If the sides could represent a right triangle in addition, then indicate so. Make no assumptions about the order of the input for the three sides. For example, the user may input 3 5 4, or 1 2 3, or 4 8 10. Design appropriate prompts and output for your program.
Algorithm Hints: Given proposed triangle sides a, b, and c, then a triangle is possible if c < (a + b) when c is the largest side. A right triangle is possible when (c * c) = (a * a) + (b * b) when c is the largest side.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
