With object oriented approach in mind, design the followingsystem
Four streettraffic signals, one on each corner of two intersecting streets.
Each trafficsignal may show green, yellow or red color light; in that order;
and only onecolor can be shown at a time.
The length of eachcolor showing is determined by a timer, different for each light colortransition:
Green: 15seconds; Yellow: 3 seconds; Red: 18 seconds
The colors cycleindefinitely: Green -> Yellow -> Red -> Green -> Yellow ...
Two lights onopposite sides of the intersection are synchronized to show the same lightcolor.
The other twolights must show the opposite:
if lights A1and A2 show red, lights B1 and B2 must show green.
if lights A1and A2 show green, lights B1 and B2 must show red.