Sorry was busy.
Either way, I think it would help if you read the tutorial on functions:
http://www.cplusplus.com/doc/tutorial/functions/
cout << "Tan(" << deg << " degrees): " << setw(8) << fixed << setprecision(4) << myTan() << endl;
Whether you're using a function called "myTan" or the standard "tan", the way you call it here doesn't make sense: the tan(x) function takes in one argument, x, in radians. You are currently calling it here with 0 arguments.
1 2
|
mySin(deg/180*3.141592);
myCos(deg/180*3.141592);
|
This is okay because you are calling the sin or cos function with an actual number, but the problem is that you do nothing with the value from this function. You should assign it to something
double my_value = mySin(my_number);
______________________________
Edit: Just saw your post above.
The assignment doesn't make sense, I don't know why your professor wants the return value of your cos and tan function to be void, and for the tan function to not take any arguments...
As well as the above advice, I would suggest making your own trig functions by using taylor series approximations.
http://en.wikipedia.org/wiki/Taylor_series#Approximation_and_convergence
The above link shows the series that equates to the sin(x) function.
You could also try googling a taylor series trig implementation in C++ on google.
The cos(x) function is similar, but you can use the identity
cos(x) = sin(Pi / 2 - x).
And finally, you can define MyTan(x) as MySin(x) / MyCos(x).
If you're working with degrees, remember that you'll have to convert the degree value into radians inside the function.