Compare a string input to an Enumerated type
I am looking to do a comparison of a string to and enumeration. I have written a sample code of what I am attempting. Since a String and and Enumerated type are different, how do I go about doing this properly in Ada? WITH Ada.Text_IO; USE Ada.Text_IO; PROCEDURE ColorTest IS TYPE StopLightColor IS (red, yellow, green); response : String (1 .. 10); N : Integer; BEGIN Put("What color do you see on the stoplight? "); Get_Line (response, N); IF response IN StopLightColor THEN Put_Line ("The stoplight is " & response(1..n)); END IF; END ColorTest; First instantiate Enumeration_IO for StopLightColor