![]() |
|
#1
|
|||
|
|||
Very Very Very Very Urgent HelpHi everyone
i'm trying to design, implement and test a class that represent a traffic light . with the states like. State Lights patternLights 0 Red light on Red light on 1 Red light on Green light on 2 Red light on Orange light on 3 Red light on Red light on 4 Green light on Red light on 5 Orange light on Red light on Then need a child class derived from this call.Does exactly the same as parent class but between 3pm and 6pm in the afternoon, the states become: State Lights PatternLights 0 Red light on Red light on 1 Red light on Green light on 2 Red light on Orange light on 3 Red light on Red light on 4 Green light on Red light on 5 Green light on Green light on 5 Orange light on Orange light on I've started some of the coding on this already, but really need some help. I'm brand new to programming .My next post will be what I've coded so far. Please need urgent help.Any help would be appreciated very much. |
|||
|
#2
|
|||
|
|||
Re: Very Very Very Very Urgent HelpUnfortunately this brief is rather hard to interpret. Does the class need to be aware of the actual time? Are you meant to set the states yourself or are they time dependent? Is it meant to provide a real-time control to respond to traffic? At the very least I think we need an outline of the sort of interface you want. This sounds somewhat like a homework question too, which one should generally not be responding to entirely. If you post some more details and some concrete code then I might have some suggestions.
|
|
#3
|
|||
|
|||
Re: Very Very Very Very Urgent HelpHi
Thank you. Does the class need to be aware of the actual time? Yes, computer time. Are you meant to set the states yourself or are they time dependent? The parent class no doesn't need time at all.But the child class yes needs to use time.It does whatever parent class does but from the time I said it will change it's states. Is it meant to provide a real-time control to respond to traffic?Not really, just showing atraffic light working. I 'll tyr to send a bit code.The only clue I can get is maybe static machine can be a good way.But can be another way too maybe. |
|
#4
|
|||
|
|||
Re: Very Very Very Very Urgent HelpQuote:
You have two state 5s in the derived class. Are you trying to introduce a sixth state? In state machines, we describe (at least) states and transitions. The transitions are implied in your text. Better is to explicitly state both your states and transitions. The notation of "Lights" and "[pP]atternLights" suggest some kind of display object instance. Why not clarify what they are exactly. The idea that the 3pm to 6pm time be accurate suggests some challenges in writing a Very Very Very Very Urgent reply. One would either have to wait until the desired time slot, or modify one's computer clock during testing. :davis: |
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple Data Display, URGENT! | Kobza | MS Visual C++ / MFC Forum | 4 | 26-Apr-2005 04:47 |
| Urgent Due In 2 Days | eccoflame | C Programming Language | 7 | 23-Apr-2005 17:39 |
| Communication via the rs232 interface | banur22 | C++ Forum | 1 | 13-Apr-2005 11:04 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The