Hello everyone. For my Math class I get a bonus credit of 40 points if I write a C++ program that does the following:
--------------------------------------------------------------------------------
1. Write a function called nameQuadrant that will tell if the angle is in the first, second, third or fourth quadrant. Remember, angles can also be negative so and angle that is 89 degrees will be in the first quadrant, while an angle that is -89 degrees will be in the fourth quadrant; that is, it is reversed. MAKE SURE THAT YOUR IF STATEMENTS THAT TELL WHAT QUADRANT THE ANGLES BELONG IN GO UP TO AT LEAST 720 DEGREES. THAT IS, TWO FULL ROTATIONS.
2. If an angle is 90, 180, 270 degrees, etc. it is said to be “quadrantal” if their terminal side coincides with a terminal axis. You will need an if statement to check if the angle is quadrantal.
3. Write a function called isCoterminal that will tell if two given angles are coterminal. Coterminal angles are two angles that share a common terminal side.
angle1 = angle2 + n * 360 (where angle1 is the first angle the user entered and angle2 is the angle the second user entered and 360 is a complete revolution.)
For example:
Is an angle measuring 200 degrees coterminal with an angle measuring 940 degrees?
940 = 200 + n * 360
740 = n * 360
360 does not go into 740 evenly so the angles are not coterminal.
Is an angle measuring -70 degrees coterminal with an angle measuring 290 degrees?
-70 = 290 + n * 360
-360 = n * 360 (add -290 to both sides)
n = -1 (divide both sides by 360)
-360 divided by 360 is -1 with no remainder, so the angles are coterminal.
--------------------------------------------------------------------------------
I appreciate any help from anyone for any part of this. I tried to learn C++ but I figured why not ask the professionals instead of spending my time on learning something that I'll never use again.
Thanks
1) To test this, all you need to do is keep adding 360 (or 2pi) if it is a negative angle, or subtract if it is above 360. Take this number and determine which quadrant it is in. Not sure why they say it needs to go up to 720 degrees.
2) This is easy. Simple test on angle retrieved from step 1.
3) You have the formulas written out here to solve this.
Thanks for the reply. The problem is I'm not a computer major student and I only know a few things in C++. Idk why our professor ask us to do such a thing but I will try to do it to get that 40 points extra credit. I was hoping maybe someone code help me with writing the code for this program or give me ideas on how I can do it myself.