GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 14-Apr-2007, 11:08
Rosemary Rosemary is offline
New Member
 
Join Date: Apr 2007
Posts: 2
Rosemary is on a distinguished road

Very Very Very Very Urgent Help


Hi 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  
Old 14-Apr-2007, 16:21
mrcheesewheel mrcheesewheel is offline
New Member
 
Join Date: Apr 2007
Posts: 8
mrcheesewheel is on a distinguished road

Re: Very Very Very Very Urgent Help


Unfortunately 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  
Old 14-Apr-2007, 19:35
Rosemary Rosemary is offline
New Member
 
Join Date: Apr 2007
Posts: 2
Rosemary is on a distinguished road

Re: Very Very Very Very Urgent Help


Hi

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  
Old 18-Apr-2007, 05:05
davis
 
Posts: n/a

Re: Very Very Very Very Urgent Help


Quote:
Originally Posted by Rosemary
Hi 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.

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 GIDBlogDeveloping GUIs with wxPython (Part 3) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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

All times are GMT -6. The time now is 18:09.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.