The Artima Developer Community
Sponsored Link

Java Answers Forum
java program help!!

3 replies on 1 page. Most recent reply: Apr 30, 2004 7:00 AM by Sanjay Perera

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Anthony

Posts: 3
Nickname: kingka91
Registered: Sep, 2003

java program help!! Posted: Apr 13, 2004 2:23 PM
Reply to this message Reply
Advertisement
The car washing team at Acme Car Wash takes 4 minutes to wash a car and six minutes to wash a suv. On average a vehicle arrives at Acme every four minutes (25% chance of arrival at any given minute) This vehicle has a 30% chance of being a suv. The cost of washing a car is $3.00. The cost of washing a suv is $5.00. The charge for a car wash is $17.00. The charge for a suv wash is $22. Write a program to simulate a 10 hour day.

Write a vehicle queue class, a application driver class, and a cashier class .


using queue... e-mail me and if get the program right, u will be paid in reasonable price... kingka91@yahoo.com


The pseudo code for the simulation is:



initialize statistical counters
Create the queue for time-stamped vehicle
For each minute in the day’s operation
3.1 Call random number generator to determine if a new vehicle has arrived

3.2 If a new vehicle has arrived THEN

3.2.1 Determine if it is a car or suv

3.2.2 Time stamp and enqueue it into the queue of vehicles

3.3 IF no car is currently being washed AND the queue of waiting vehicles is not

empty then

3.3.1 Dequeue a vehicle from the queue for washing

3.3.2 Use the time stamp for the vehicle just dequeued to determine how long it

waited.

3.3.3 Add that wait time to the accumulating total wait time

3.3.4 Record that washing a vehicle has just begun

3.4 If a vehicle is being washed then

3.4.1 Reduce by one minute the time left before the vehicle is completely washed





For the random number generated: if rnd<= .25 a vehicel has entered the queue. If rnd >.25 a car has not entered the queue.

If the random number generated for vehicle determination is <=.30 then the vehicle is a suv . If >.30 the vehicle is a car.

Output:



Vehicle Vehicle Entry Wait
Number Type Time Time
-------- ----- ----- -----





Average wait time: ---------
Total Vehicles Washed: -------
Revenue: -------
Profit: --------

Total SUVS washed: ------------- % of Total --------
Total Cars washed: ------------ % of Total ---------


mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: java program help!! Posted: Apr 13, 2004 9:51 PM
Reply to this message Reply
Do u want the whole prorgamme?

How much marks are u expecting to get in ur x'ams for this assignment.

twc

Posts: 129
Nickname: twc
Registered: Feb, 2004

Re: java program help!! Posted: Apr 14, 2004 11:50 AM
Reply to this message Reply
Have you written any code or are you expecting us to do your homework for you? I don't mind helping you find errors in your code or your logic, but I'm not doing anyones homework for them.

Sanjay Perera

Posts: 42
Nickname: angel6
Registered: Apr, 2004

Re: java program help!! Posted: Apr 30, 2004 7:00 AM
Reply to this message Reply
Cheeting!!! Grrr

Flat View: This topic has 3 replies on 1 page
Topic: Help me Previous Topic   Next Topic Topic: Java program as service in Win 98 SE

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use