Reference no: EM132196851
Question :
Write a C program that solves for any one of the following unknown parameters of a right triangle, if given two other known parameters from the following list:
Length of the base.
Length of the vertical side.
Length of the hypotenuse.
The angle between the base and the hypotenuse.
The angle between the vertical side and the hypotenuse.
The program should prompt the user to choose which one of the unknowns they want to solve for and take as input into the program the input from the user.
The program should then prompt the user which of the two known quantities they have (make sure to include logic to exclude the option of the unknown variable value that they are trying to compute).
Then take as input the values of the known quantities and compute the unknown quantity and print the result to the screen.
This program will require you to utilize the concepts of:
-Datatypes (you probably don't want to use int's...)
-Variables
-Getting data from the outside world into your program.
-Writing to the screen (use the printf function).
-Doing simple arithmetic/trigonometric operations on the values stored in the variables and storing that into another variable.
-Control flow (if/else statements)
-Possibly loops (for loops, while loops, etc).
-And other minor details (all of which are covered in your required reading assignment on C
- please don't ask where this is located at, simply look in Week 7 for the reading assignment - it is there).
-All angles should be in degrees (you may have to convert from radians to degrees).
You may use features from C++ if you would like (such as cin and cout from the std library) since you can think of C++ as a superset of C.