Docsity

Applied problem solving, Schemes and Mind Maps of Law

Toggle sidebar
bg1
1.Start
2.Set the Greenlight duration = 50s
3.Set the Amberlight duration = 20s
4.Set the redlight duration = Greenlight duration
+ Amberlight duration
5.Set walkrequest = false
6.Set card detected = false
7.While true
a.Display “ Red light Is on!!”
8.Prompt for walkrequest
9.If walkrequest is pressed
a.Set walkrequest = true
b.Display (“walk request detected”)
c. Reduced the redlight duration by 10
seconds
10. Prompt for car detection
11. If car is detected on the light
a.Set car detection = true
b.Display (“ car detected at the red light”)
c. If detected cars are more than 5
i. Reduced the wait time by 10 seconds
12. Wait for redlight duration seconds
13. Reset to step 4
14. end

Partial preview of the text

Download Applied problem solving and more Schemes and Mind Maps Law in PDF only on Docsity!

1.Start 2.Set the Greenlight duration = 50s 3.Set the Amberlight duration = 20s 4.Set the redlight duration = Greenlight duration

  • Amberlight duration 5.Set walkrequest = false 6.Set card detected = false 7.While true a.Display “ Red light Is on!!” 8.Prompt for walkrequest 9.If walkrequest is pressed a.Set walkrequest = true b.Display (“walk request detected”) c. Reduced the redlight duration by 10 seconds
  1. Prompt for car detection
  2. If car is detected on the light a.Set car detection = true b.Display (“ car detected at the red light”) c. If detected cars are more than 5 i. Reduced the wait time by 10 seconds
  3. Wait for redlight duration seconds
  4. Reset to step 4
  5. end