Construct a class named light that simulates a traffic


Question: Construct a class named Light that simulates a traffic light. The class's color attribute should change from Green to Yellow to Red and then back to Green by using the class's change() method. When a new Light object is created, its initial color should be Red.

Solution Preview :

Prepared by a verified Expert
Programming Languages: Construct a class named light that simulates a traffic
Reference No:- TGS02311922

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)