C ++ Demonstration: Write a program that prompts the user to input three positive angle values in degrees to determine which type of triangle it is (acute, right, obtuse). TEST CASES: If a user inputs three valid angle values: Enter the first angle in degrees: 60 Enter the second angle in degrees: 30 Enter the third angle in degrees: 90 Result: You have a right triangle! If a user inputs any negative angle values: Enter the first angle in degrees: 45 Enter the second angle in degrees: 55 Enter the third angle in degrees: -80 Result: Error! Please input a positive angle value. If a user inputs values whose sum exceeds 180: Enter the first angle in degrees: 20 Enter the second angle in degrees: 70 Enter the third angle in degrees: 100 Result: Error! It is not a triangle.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
C ++ Demonstration:
Write a program that prompts the user to input three positive angle values in degrees to determine which type of triangle it is (acute, right, obtuse).
TEST CASES:
If a user inputs three valid angle values:
Enter the first angle in degrees: 60
Enter the second angle in degrees: 30
Enter the third angle in degrees: 90
Result: You have a right triangle!
If a user inputs any negative angle values:
Enter the first angle in degrees: 45
Enter the second angle in degrees: 55
Enter the third angle in degrees: -80
Result: Error! Please input a positive angle value.
If a user inputs values whose sum exceeds 180:
Enter the first angle in degrees: 20
Enter the second angle in degrees: 70
Enter the third angle in degrees: 100
Result: Error! It is not a triangle.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 6 images