I have a little problem...I have 4 items and I need to pick the best item...after I get 2 values from a textbox....
Item Value1 Value2
A 256 8
B 512 14
C 512 28
D 1024 60
I need to pick an item which can handle the number...
for example...
Value1 = 100 and Value2 = 6 Returns Item A
Value1 = 100 and Value2 = 10 Returns Item B
Value1 = 600 and Value2 = 2 Returns Item D
Can anyone give me a good algorithm to solve this?
Should it always go the one higher? So if you have an item say 354 12 and and an item 454 12 you are looking for 355 12 it will choose 454 12? Im a bit confused as to the priority of the checking. is it the first number to check first then the second or vice versa? What do the 2 numbers represent as im confused as to why your 2 examples of 100 return A and B?
Last edited by Blobby; Sep 19th, 2002 at 07:35 AM.
There are 3 types of people in this world.........those that can count, and those that can't.
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details
Okay, I was posting before you wrote that, I've modified it slightly - the last one added both numbers up & checked for the line with the highest entry, this one makes sure both individual numbers are higher...
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details