Re : I need help..thanks u all :)

Write a program to simulate the process of cars waiting in line and being served at a highway toll plaza UPM. Assume there are 4 toll booths and ONLY one line of cars that feed into them. Time is measured in second and can be declared as int. The time between car arrivals and the time that it takes for car to be served at toll both are random variables. Assume that the average time between arrivals to be 2 seconds and the average service time to be 16 seconds. Test your program for a different type of inputs (i.e., arrival time, service time, and simulation time), and the output of the application must record the following statistics:

CustomerWaiting Time (sec)Service Time (sec)Queue No.

1

2

3

4

?

Number of queue:

Enter arrival time:

Service time (seconds):

Duration to run simulation (minutes):

XX customers are served by YY with average waiting time: Z.

thanks a lot lo :):)

[969 byte] By [hiewpsa] at [2007-10-3 3:32:13]
# 1
No problem, glad to help.
ScarletPimpernela at 2007-7-14 21:26:24 > top of Java-index,Java Essentials,Java Programming...
# 2
> Write a program Done. What next?
CeciNEstPasUnProgrammeura at 2007-7-14 21:26:24 > top of Java-index,Java Essentials,Java Programming...
# 3
im jz a new programming student of java, but i do not know how to write the source code of this program..seemed so complicated...
hiewpsa at 2007-7-14 21:26:25 > top of Java-index,Java Essentials,Java Programming...
# 4
> im jz Im scarletpimpernel
ScarletPimpernela at 2007-7-14 21:26:25 > top of Java-index,Java Essentials,Java Programming...
# 5

> im jz a new programming student of java, but i do not

> know how to write the source code of this program..

> seemed so complicated...

Any program is complicated when you're starting out. You have to accept that and find a way to deal with it. In this case, this isn't the right way to deal with it.

If you're at the level of really not knowing how to get started, your best bet is to go back to your tutor and/or work with your peers on the course.

Asking for someone to do the program for you or just leaving it out there for someone here to write a step-by-step is not going to help you at all.

marklawforda at 2007-7-14 21:26:25 > top of Java-index,Java Essentials,Java Programming...
# 6

You better start doing this early

do not rush to writting the code, instead make sure you

design your classes and interfaces correctly.

It will make your code writting much easier and faster

post only when you get a more specific problem which shows that

you have put in some effort

r035198xa at 2007-7-14 21:26:25 > top of Java-index,Java Essentials,Java Programming...
# 7
if...i post my source code, and i meet some errors, can u help me to check?
hiewpsa at 2007-7-14 21:26:25 > top of Java-index,Java Essentials,Java Programming...
# 8
even my tutor or coursemates also no idea abt it...
hiewpsa at 2007-7-14 21:26:25 > top of Java-index,Java Essentials,Java Programming...
# 9

> if...i post my source code, and i meet some errors,

> can u help me to check?

Definite yes. Just:

- make sure it's formatted: http://forum.java.sun.com/help.jspa?sec=formatting

- make sure you describe the problem, the expected result and the actual result, or the exact and complete error message

- make sure you post the relevant part of your code only, instead of dumping the whole thing on us

CeciNEstPasUnProgrammeura at 2007-7-14 21:26:25 > top of Java-index,Java Essentials,Java Programming...
# 10

> if...i post my source code, and i meet some errors,

> can u help me to check?

That's pretty much exactly what this place is for. Talk it over with your tutor if you need to, put your ideas on paper, get them straight then start coding.

If and when you come up against a problem look at the error messages, search on the net, search these fora and, if you haven't found an answer you understand, post your code and a question and guys around here will help you out.

marklawforda at 2007-7-14 21:26:25 > top of Java-index,Java Essentials,Java Programming...
# 11

okokok..

im goin to ask the basic things which i do no understand...

static int numServers;

static int numClients:

1)the source code above is it initializing the variables?

what is the use of static?

static Server[ ] servers;

2)creating array?how about

static Queue queue = new ArrayQueue( )

3)creating array as well?what is the use of static?

static java.util.Random randomArrival;

4)randomly?

hiewpsa at 2007-7-14 21:26:25 > top of Java-index,Java Essentials,Java Programming...
# 12

> im goin to ask the basic things which i do no

> understand...

Answering this is exactly what your teacher gets paid for. We're here to solve problems and discuss some issues and maybe have a little fun, but not to teach you Java.

Do you know these:

http://java.sun.com/docs/books/tutorial/

CeciNEstPasUnProgrammeura at 2007-7-14 21:26:25 > top of Java-index,Java Essentials,Java Programming...
# 13
hmm..okok....actually im learning java alone...no teacher is teaching jz tutor teach us..but he seemed mroe blur than uslooks like i hv to explore myself...thanks for ur advice and ecouragement!
hiewpsa at 2007-7-14 21:26:25 > top of Java-index,Java Essentials,Java Programming...