Andi03 Posted September 17, 2007 Posted September 17, 2007 Hi. If I enter a function into a textbox, for example f(x) = 3x+1 where the 3x+1 is the part entered into the text box. How can I from that calculate the values for x = 2, x = 3 and so on so I can stor the values in array. Im making a application that will plot the function intp a graph so I need to calculate som of the values the function will return so I can plot it. If im not clear in my text respond and I'll try to explain more. Thanks for any help that will be given to me. //A Quote
mskeel Posted September 17, 2007 Posted September 17, 2007 You'll need to parse the entered formula and then apply values to the variables detected. Don't forget your order of operations! If you search around the web, you might be able to find someone who has done this already and you can leverage their code or at least get some ideas. You will probably find a stack structure useful for determining order of operations as you parse. Quote
Andi03 Posted September 18, 2007 Author Posted September 18, 2007 Thanks! I will look in to it. I want to try it befor looking at others work. I will now been googleing parse formula and look up stacking in my old programming book. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.