Bruno van Dooren [MVP VC++] wrote:
> *> Hi i have to program a code to perform 1 of 5 functions at the
> users
> > request, I have got to the part where i have to program the
> equations
> > and i cant seem to get them to link together. Basicly when the
> used
> > enters his radians i was to link to a sin x function to calculate
> the
> > sin of the number also there will be a factorial function and a
> cos
> > function. but none of them are linking.
>
> Hi,
> It would be helpful if you include the actual error messages.
> We are not yet clairvoyant.
>
> If you do math you should also include math.h.
> Look in MSDN to see which functions are contained in which library.
> There should be no need to program sin and cos functions yourself.
>
> --
>
> Kind regards,
> Bruno van Dooren
> bruno_nos_pam_van_dooren@hotmail.com
> Remove only "_nos_pam" *
I managed to get it to work today. The C.math function was banned for
this project so thats out the window.
The next question is how do you get the code to Loop. i.e when the used
starts the program he selects what he wants to do and runs one. How do i
then let him re loop and select another option to start again.
Without using the goto function. as that is what i sued and got told
not to.
Bruno van Dooren [MVP VC++] - 14 Nov 2006 09:30 GMT
> I managed to get it to work today. The C.math function was banned for
> this project so thats out the window.
Then use a 3d party math library. there are several open source ones.
But don't invent it yourself.
> The next question is how do you get the code to Loop. i.e when the used
> starts the program he selects what he wants to do and runs one. How do i
> then let him re loop and select another option to start again.
Put the body of your code in a while loop, and use a boolean for the loop
condition that gets set to false when the user chooses that quit option.

Signature
Kind regards,
Bruno.
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"
Ben Voigt - 14 Nov 2006 21:09 GMT
>> I managed to get it to work today. The C.math function was banned for
>> this project so thats out the window.
>
> Then use a 3d party math library. there are several open source ones.
> But don't invent it yourself.
It's almost certainly a university project, sounds as if he's banned from
using any library functions other than iostream.
>> The next question is how do you get the code to Loop. i.e when the used
>> starts the program he selects what he wants to do and runs one. How do i
>> then let him re loop and select another option to start again.
>
> Put the body of your code in a while loop, and use a boolean for the loop
> condition that gets set to false when the user chooses that quit option.
Bruno van Dooren [MVP VC++] - 16 Nov 2006 20:17 GMT
>>> I managed to get it to work today. The C.math function was banned for
>>> this project so thats out the window.
[quoted text clipped - 4 lines]
> It's almost certainly a university project, sounds as if he's banned from
> using any library functions other than iostream.
In that case he could maybe use a source library (i.e. no binary but just
sources with functions).
It depends on the reason for the ban.
If the point of the project is to learn how to implement algorithms in code,
using a lib is out of the question of course.

Signature
Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"
Mihajlo Cvetanović - 14 Nov 2006 09:36 GMT
> The next question is how do you get the code to Loop. i.e when the used
> starts the program he selects what he wants to do and runs one. How do i
> then let him re loop and select another option to start again.
Here's some general purpose pseudo-code:
for (;;)
{
<input>;
if ( <should exit> )
break;
<process input>;
}