Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE HELP WITH PSEUDOCODE OR FLOWCHART PROGRAM FOR THE FOLLOWING. Write a program that controls a traffic light and crosswalk at a four way intersection.
PLEASE HELP WITH PSEUDOCODE OR FLOWCHART PROGRAM FOR THE FOLLOWING.
Write a program that controls a traffic light and crosswalk at a four way intersection. One 2 lane road goes East/West, and one 2 lane road goes North/South. There is also a crosswalk that crosses each road. - A light's cycle ends when the light changes from red to green, or from green to red Normal operation changes both lights simultaneously every 2 minutes. The crosswalk matches the right of way indicated by the light (green means walk) - A cycle can be interrupted if a pedestrian pushes the crosswalk button in the following ways: o o o o If any button was pressed within the current cycle, ignore this press; do not record press as either successful or unsuccessful If the button was pressed and successful within the previous cycle, ignore this press; this press is considered unsuccessful If the cycle is within the first minute, the lights will change in 30 seconds; this press is considered successful If the cycle is is after the first minute, wait until the normal cycle ends; this press is considered unsuccessful . After interruption, normal operation resumes You may assume that at the beginning, the light is green in the N/S direction, and red in the E/W direction, and there have been no button presses Your program may use the following operations: . Check the status of a button ("pressed"true, "not pressed" false). .Turn N/S light to some color Turn EW light to some color Wait a few seconds. Light the Walk/Don't walk sign for N/S light . Light the Walk/Don't walk sign for E/W light Get the current time . Perform arithmetic operations: add, subtract, multiply, divide, integer quotient, integer remainder - Perform numeric comparisons: equals, does not equal, less than (or equal to), greater than (or equal to) Perform boolean operations: and, or, not Make decisions Loop (go back to an earlier point in the program)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started