One of my students has situated his code based off the PLTW curriculum for 1.2.4 Survey Says. My whole class and I have analyzed his code from top to bottom and can't seem to get rid of this Runtime Error that's attached. I've uploaded a screenshot of their code as well to show what we have been looking at for a few days. Any help would be appreciated.
There is an unspoken Assertion in effect for your code to work, that FlavorPicker.Selection should contain a flavor.
But the FlavorPicker .AfterPicking event violates that convention, by adding 'You picked' to the Selection, thus thwarting the index determination in global flavorList.
Find an alternative way to display the selection, for example by using a List Picker and setting its .Text to the embellished Selection value.
P.S. I searched for some imagery to show how bad an idea it is to allow data to flow backwards in a system, just as how bad it is for a plumbing system to allow water to flow backwards.