Unit 4 set screen - decision making app help

We’re expecting the screen to change based on drip and color. Is this a logic problem? Or is there something missing?

Sometimes the screen changes, but we can’t quite figure out the pattern or what might be conflicting.

You want to modify the variables prior to calling updateScreen() in each of the event handlers. This should fix the issue.

I will also add that for the drip, since it is a number, should be calling getNumber() and not getText(). It should also be initialized as a number instead of “”. This isn’t critical in App Lab, but if the student goes on to learn other programming languages, understanding the different data types is crucial and this would cause errors.

1 Like

Thank you! That did it!