Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / November 2006

Tip: Looking for answers? Try searching our database.

Combining Functions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nutkin - 13 Nov 2006 18:36 GMT
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>;
}

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.