I'm building a beginner robotics kit and I need the controllogic worked out before I wire anything up. Type in thecolor the light is showing, and print what the drivershould do.Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.
if, else if, else if.Console.ReadLine() already gives you a string — there is nothing to parse here.==, the same way you compared numbers in Activity 1.13.else is for — decide what it says and write it down in your requirements list.Only one-star challenges have this section. If you already know how to begin, skip it — and when you move up to two stars, working out the order yourself is part of the job.
Console.ReadLine(). No parse needed — it is already text.if (color == "red") first, then chain the other two with else if.else for anything that is not red, yellow, or green.What color is the light? yellow
Slow down.Verified in a real run against all four cases — red prints “Stop.”, green prints “Go.”, and anything else falls into your final else.
Your requirements list and your program file, named cc-traffic-light.