Can you use a loop function to solve a simple calculation?
$10-15 USD
Completed
Posted almost 13 years ago
$10-15 USD
Paid on delivery
I sometimes have to write simple calculators in ASP that because of the approximations used result in one output value being slightly inaccurate. I can compensate by lowering an input value slightly and getting the correct output value but would like to do this dynamically. I wonder if this can be done simply in ASP by looping the calculation (I have tried but without success but I am not a coder).
I have attached a very simple ASP script- I know it is not well written but it will do to test the concept- that sets a target value (t) for the output of a total (s) comprised of 3 simple calculations, s1, s2 and s3. The way the calculations are set it is impossible to put say 10 in and get 10 out. But if you put say 5 in you will get 10 out. This is an extreme example of what I am trying to do.
Can you take a target value say 15, and add code that will enable the 3 simple calculations to loop until 15 is obtained but leave the target value unchanged?
I can do this easily in Excel using Goal seek and changing a cell so that users don't see the cell containing the changed value. I am fairly certain that this can be done in ASP so this project is really to see if someone can do this for this test calculation.
If so, I need what you to explain what you have done.
## Deliverables
The simple script is given in the zipped folder.
Am image of what I am trying to do is also provided.
* * *This broadcast message was sent to all bidders on Monday May 2, 2011 4:37:07 PM:
Ok I have not explained this project well. Apologies. What do I want? What do I want. I want coders to devise an ASP script that will take the number inputted (t) and cycle calculations s1, s2 and s3 so that their sum (s) is equal to (t) but leave the input number on the form itself unchanged. The calcualtions s1 etc have no significance. I will not use them. Hopefully this help? Mike