Đã Đóng

Write some Java software -- 3

### Coding problem: Traffic Signals

Write a program that controls the traffic signals for a four-way intersection. Initially, we consider traffic flowing in straight lines only, no turns. The four directions are S(outhbound) and N(orthbound) on Snell Rd; and W(estbound) and E(astbound) on Weaver Rd. The traffic lights should obey the following rules:

1. Cars arrive in each direction on both roads (Snell and Weaver) at the rate of 1 car per second. That is, 4 cars approach the intersection each second.

2. Only one road (Snell or Weaver) can have a "green" light at one time.

3. It is acceptable for both roads to have the "red" light at the same time. Of course, traffic backs up on both roads if this happens.

4. Start by turning on the traffic on Snell Rd "green" in both directions for 3 seconds; then turn it "red" for one second; then turn Weaver "green" for 3 seconds; and then red for one second.

5. When the light turns from red to green at any intersection, it takes the first car 2 seconds to start moving and cross the intersection. Subsequent cars take 1 second each.

6. At the instant the light turns from "green" to "red", a car may not start moving to cross the intersection; whether that car just arrived at the intersection or was waiting at that intersection.

7. The output should be the number of cars that are waiting at the intersection in each direction at each second, for the first 20 seconds. Do not make the program wait 20 seconds to produce the output: this is only a simulation, so print the output when it's ready.

8. Expected output


0: N = 0; S = 0; E = 0; W = 0

1: N = 0; S = 0; E = 1; W = 1

2: N = 0; S = 0; E = 2; W = 2

3: N = 0; S = 0; E = 3; W = 3

4: N = 1; S = 1; E = 4; W = 4

5: N = 2; S = 2; E = 5; W = 5

6: N = 3; S = 3; E = 5; W = 5

7: N = 4; S = 4; E = 5; W = 5

8: N = 5; S = 5; E = 6; W = 6


Kĩ năng: Java, Kiến trúc phần mềm

Xem nhiều hơn: java write some software, Choose one of the following companies (or any company that has been in the press) and write a 2-3 page, APA style critical analy, list of java software development companies in dubai for freshers, 1 write an e mail to your instructor informing him her that you have problem in studying the course materials and explain the re, write some software- java urgent, write some software java, write some software java urgent, write some software in java, write some software 3, java software write sms language mobile, java software coding hospital management system, software need write java, java slot machine coding, write protect software, usb memory write protection software

Về Bên Thuê:
( 0 nhận xét ) United States

ID dự án: #16752448

12 freelancer đang chào giá trung bình $24 cho công việc này


I find this project interesting. I'd like to have further details. Let me know if you are interested.

$30 USD trong 1 ngày
(1156 Nhận xét)

Hey A Java expert developer is here I have good advanced expertise in Java and Javafx I can write a Java program for you as per your need This is an initial bid Feel free to message me Regards

$25 USD trong 0 ngày
(128 Nhận xét)
$23 USD trong 1 ngày
(26 Nhận xét)

A proposal has not yet been provided

$30 USD trong 1 ngày
(12 Nhận xét)
$20 USD trong 1 ngày
(3 Nhận xét)

Hello there, I am 4+ year programmer. I will code the given program. I am well aware of different algorithm design technique. Ping me for further discussion

$20 USD trong 1 ngày
(8 Nhận xét)

Hey..Just saw your project. I have done this problem already , you can refer here : https://www.freelancer.com/projects/software-architecture/Traffic-Light-Design-16598520/ Ready to deliver you the source code asap Thêm

$15 USD trong 1 ngày
(5 Nhận xét)
$25 USD trong 1 ngày
(0 Nhận xét)

Should be done using Advanced Algorithms and Java. Complete details in documents are uploaded in files.

$25 USD trong 1 ngày
(0 Nhận xét)

A proposal has not yet been provided

$35 USD trong 2 ngày
(0 Nhận xét)
$25 USD trong 1 ngày
(0 Nhận xét)

I have already done this project

$15 USD trong 1 ngày
(0 Nhận xét)