So I have to write a program that will take formulas from the user and calculate them.
Age, Height, fights, (age+height)*fights <- user defined
10, 5, 10, 150 <- I calculate this
1, 2, 1, 3 <- I calculate this
But now let say I change the values around and I want the formula column to update dynamically is there anyway to go about doing that ? I am storing by each row into an array list which is array list of array list. Any advice or guidance would be really helpful thank you 🙂
We can revise this to make a simple engine
With this in place, we can define various functions and calculations
The problem comes when you try to make it not only user defined, but user entered. As in, a user could define the function as being one of a set of functions you have pre-entered. In this case, you’ll need to have a parser that turns something like this:
into this:
But that may be beyond the scope of your assignment. Or maybe it’s not.
Hopefully this is a little closer to your requirements than my previous example.