Question: You may not use any C statements which includes (but is not limited to) conditional statements and loops. 11.3.1 Problem Given a right triangle, the


You may not use any C statements which includes (but is not limited to) conditional statements and loops.

11.3.1 Problem Given a right triangle, the length of two of its sides, and the interior angles in radians, find the length of the missing side. Input will always be given in the order of (opposite, adjacent, hypotenuse, x, y), with the missing side omitted. In this challenge, you will be writing functions to find the missing side length using both the Pythagorean theorem and by using trigonometry. Then, print the dimensions of all three sides, and both angles. The block of dimensions should start and end with a new line. a 11.3.2 Preconditions b 11.3.2 Preconditions b You must provide a series of functions which meet the requirements in the table below. You you may include other functions as long as the requested functions execute correctly. Do not include a main function in your source or header files. In this contract, are you are only able to use a single printf statement (or cquivalent) in any of your files. Having more than one printf statement will result in a grade of zero for this contract. Each function asks you to find the opposite, adjacent, or hypotenuse using either the Pythagorean theorem (Pyth) or trigonometry (Trig). These functions will be checked to ensure proper math functions are used. Math functions can be found in the math.h library. Requirement Functions Input Parameters Conditions double findOpposite Pyth(double, double, double, double) double findAdjacent Pyth(double, double, double, double) double findHypotenusePyth(double, double, double, double) double findOpposite Trig(double, double, double, double) double findAdjacent Trig(double, double, double, double) double findHypotenuse Trig(double, double, double, double) You are given a series of positive double floating point values which represent the sides and angles of a right triangle. The values correspond to the triangle diagram provided above, such that the values will always be in the order (a, b, c, x, y). The only difference between inputs on the various functions is that the side in the name will be missing, thus only providing you four values. Those four values still remain in the same order, so, for example, if you are calling findOpposite Pyth, the function arguments you receive will be (b, c, x, y), as the opposite side (a) needs to be calculated. Your function should return a double floating point value representing the length of the missing side of the triangle. triangle.c, triangle.h Return Value Files Required 11.3.3 Postconditions Your function must output to the standard output stream, but it may only do so once per function call. The output consists of seven lines: a blank line, a line containing the value of the opposite side, a line containing the value of the adjacent side, a line containing the value of the hypotenuse, a line containing the value of the x angle, a line containing the value of the y angle, and another blank line. Each line with a value must include the name of the value and an equals sign (=). When printing your double values to the screen, you should print them to two decimal places. This is not necessarily the same as rounding! Make sure you research floating point format specifiers with printf and how to limit the number of decimal places printed. Output Input findOppositePyth( 62, 86.9770084563, 0.7772682612, 0.7935280656 ) opposite = 61.00 adjacent = 62.00 hypotenuse = 86.98 x= 0.78 y = 0.79 findAdjacent Pyth( 97, 129.6341004520, 0.8454352154, 0.7253611114 ) opposite = 97.00 adjacent = 86.00 hypotenuse = 129.63 x= 0.85 y = 0.73
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
