+ 2
Hi, I'm early into my Java days so take it easy please. Trying to recall a code that makes for a functional traffic, thoughts?
3 Respostas
+ 3
Couple errors. When you use esle, you can not test condition. Use else if to test red light. I guess you were missing 1 curly brace and ";" after System.out.println("stop");
I can not show you fixed code as app says no internet connection :/So correct those errors that I mentioned and show us again if it does not work.
+ 2
All fixed, Thanks for your help, I didnt know you couldn't test with 'else', and the other two were just sloppy mistakes, probably made in the course of trying to fix it. Runs now though ,thanks :)
https://code.sololearn.com/cLoibc2Vz8jl/?ref=app