Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hi!
I need some help with programming. I will give an example with the help of candy. The end result is depending on the flavour of the candy and classification (say quality class) of the candy. The user make different choices by clicking in list boxes. The number of alternatives in the boxes is displayed here as ["x" alternatives]
"Choice1"
The thing is the candy starts of in Class4 if it's not supposed to last longer than 1 week. If it should last longer it's increased with two classes. [2 alternatives]
"Choice2"
The second thing is the shape of the candy. If it is a flat candy it gets reduced with one class, otherwise there is no reduction. [2 alternatives]
"Choice3"
The third thing is the content. If it consists of allergic ingredients it gets reduced with one class. Otherwise there is no reduction. [2 alternatives]
"Choice4"
The fourth thing is the size (6 sizes): Size = 1,2,3,4,5 and 6 [6 alternatives]
"Choice5"
The fifth thing is the flavour (7 flavours) Flavour 1,2,3,4,5,6,7 [7 alternatives]
Script:
For candy with flavour 1, if size > 3 then reduce one class
For candy with flavour 2, if size > 3 then reduce one class
For candy with flavour 3, if size > 4 then reduce one class
For candy with flavour 4, if size > 5 then reduce one class
For candy with flavour 5, if size > 5 then reduce one class
For candy with flavour 6, if size > 5 then reduce one class
For candy with flavour 7, if size = 6 then reduce one class
otherwise there is no reduction
So... finally. Depending on which flavour and class (there are 6 classes) the candy is in gives a value for say its weight from a table (6 rows, 7 columns)
Haha, pretty messy for me! I've done a solution with a bunch of seperate if statements but, i figure that there is a much nicer way to do it. Suggestions? If there is a guide for problems like this i am very willing to learn! I have googled a bit but haven't really found anything like it.
All help is appriciated!
Solved! Go to Solution.
Thanks alot! This is exactly what i am after! I really appriciate your effort! Thanks.