So I have this question. I need to do a repetitive steps, I have 5 kind of fruit f1-f5 indicating the amount of suger in it and if f1>max(f2,f3,f4,f5) then label=one; else if f2>max(f1,f3,f4,f5) then label=two; else if f3>max(f1,f2,f4,f5) then label=three; else if f4>max(f2,f3,f4,f5) then label=four; else if f5>max(f1,f2,f3,f4) then label=five; if (f1+f2)<=10 and max(f3,f4,f5)<20 then label=type2one; else if (f1+f3)<=10 and max(f2,f3,f4)<20 then label=type2one; else if (f1+f4)<=10 and max(f2,f3,f4)<20 then label=type2two; else if (f1+f5)<=10 and max(f2,f3,f4)<20 then label=type2three; else if (f2+f3)<=10 and max(f3,f4,f5)<20 then label=type2four; else if (f2+f4)<=10 and max(f3,f4,f5)<20 then label=type2five; ..................and on and on; but basically there is a rule that for "single fruit" case,you just exclude the one used up frount and for for the "two fruit" case, you exlcude whatever two mentitoned first, So I hope to do something like, array fruit1 {*} f1 f2 f3 f4 f5 array fruit2 {*} f1 f2 f3 f4 f5 do i=1 to 5; if fruit(i)>max(fruit but fruit(i)) if fruit(i))+fruit(i+1))<=10 and max(fruit but (fruit(i) ,fruit(i+1))) ; *<- here I have another problem though, i is supposed from 1 to 5 but here it will be ended with 6 not really that I want; Please let me know how do you do it. Appreiciate your help.
... View more