Hello ya’ll! I need your help to help me with my assignment. Just like the previous assignment, I have an extremely difficult time completing all of my HW so far because, 1, the instructor is horrible, and 2, I’m actually in a high level Computer Science class since Computer Science l states’ specially it’s an introduction course to Computer Science. I was actually supposed to enroll in Exploring Computer Science first but I did not see that as an option until it was already too late. Anyways, I hoping if you can figure this out one for me and I’ll use the same formula for my codes and won’t use the one’s I have not learned yet in class. By the way, I have never taking Trigonometry so I have no idea where to start.
For this assignment, you will be calculating the hypotenuse and standard trigonometric values (sine, cosine, tangent), and cotangent for a right triangle of arbitrary size. Your program will start by asking the user for the lengths of the adjacent and opposite sides of a right triangle. Then your program will do the calculations for the items listed above, and display the results. The calculation to find the hypotenuse is:
hypotenuse 2 = opposite 2 + adjacent 2 , or hypotenuse = sqrt(opposite 2 + adjacent 2)
You can use the <cmath> library to get access to the pow() and sqrt() functions.
The calculation for sine, cosine, tangent, and cotangent are as follows:
http://postimg.org/image/vxw5ln2hh/
I want your program to ask if the user would like to do another calculation. If the user says “yes,” then ask them for the adjacent and opposite sides of a triangle again, and do the calculations again. You can put the relevant code inside of a while or do-while loop to do this.
Sample Output
Welcome to Rob's trigonometry calculator.
Please tell me the lengths of the adjacent and opposite sides of a right triangle.
Adjacent side length: 1.2
Opposite side length: 3.4
Based on an adjacent side of 1.2 and an opposite side of 3.4,
the hypotenuse has length 3.60555.
The sine of the angle is 0.94299.
The cosine of the angle is 0.33282.
The tangent of the angle is 2.83333.
The cotangent of the angle is 0.352941.
Would you like to do another calculation? (Y or N): Y
Adjacent side length: 2.5
Opposite side length: 1.7
Based on an adjacent side of 2.5 and an opposite side of 1.7,
the hypotenuse has length 3.02324.
The sine of the angle is 0.56231.
The cosine of the angle is 0.826927.
The tangent of the angle is 0.68.
The cotangent of the angle is 1.47059.
Would you like to do another calculation? (Y or N): N
Design Considerations
You will need the <cmath> library to have access to pow() and sqrt(). Please check for division by zero; don’t rely on the compiler to catch a divide by zero error. You will lose points on the assignment if your program allows division by zero, so check for zero before doing division. Follow the style guide for all of your relevant code items, including proper indentation, variable names, etc. Do not use literal values in your calculations; use constant globals instead. For example:
const double DEGREES_PER_RADIAN = 57.296;