Question: C# Create a program that responds to a traffic light Instructions: Ask the user to input the current traffic light color ( red , yellow,

C# Create a program that responds to a traffic light
Instructions:
Ask the user to input the current traffic light color (red, yellow, green).
Use a decision statement to print the following actions:
If the color is red, print "Stop".
If the color is yellow, print "Slow down".
If the color is green, print "Go".
If the user enters an invalid color, print "Invalid input - slow down."
Make the program case-insensitive, so it handles "RED", "red", "Red" equally.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!