Question: I need help comling this into C++ Visual Studio. Write a program that determines if a given triangle is a right triangle or not. The
I need help comling this into C++ Visual Studio.
Write a program that determines if a given triangle is a right triangle or not. The program should read the length of the 3 sides of a triangle. All numbers will be integers. The sides can be entered in any order.
If sum of the squares of the two small sides (called the legs) equals the square of the longest side (called the hypotenuse), then the triangle is a right triangle:
Sample Run #1: (the highlighted text is what the user types)
3 sides? 3 4 5
Longest side is 5
It is a right triangle
Press any key to continue . . .
Sample Run #2: (the highlighted text is what the user types)
3 sides? 5 4 3
Longest side is 5
It is a right triangle
Press any key to continue . . .
Sample Run #3: (the highlighted text is what the user types)
3 sides? 3 3 5
Longest side is 5
It is NOT a right triangle
Press any key to continue . . .
Other Considerations:
| Did you remember system(PAUSE)? |
|
| Did you include comments? |
|
| Did you use constants? |
|
| Did you use good variable names? |
|
| Do you have consistent indentation? |
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
