Students created calculator code.
Jan 27, 10:24 PST
I was trying to make a calculator app in the App Lab when I tried using switch statements. When a switch statement is used the first time in an app, it will use the correct case. When a switch statement is used after the first time in an app, it will use the first case and not the correct one, even if it is a different data type. I have observed this in multiple different Apps and with multiple different variables and data types. I am running Chrome 79.0.3945.130 (64-bit) on Windows 10 Home 64-bit.
Switch-case statements have never worked well for me. Unfortunately there is likely nothing wrong with the code, just rather something wrong with code.org itself. It’s best just using if statements instead as they are more well-supported.