473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Traffic light structure array

Does anybody know the structure of an array that could be used to handle a traffic light sequence?
Oct 8 '16 #1
1 1646
Oralloy
988 Expert 512MB
shainarushton6,

What sort of information do you want in the sequence? Strings? Objects?

Unless you can give more information about what you want to accomplish, I don't think that we can help you beyond suggesting an array of objects, or a "Map", depending on what the index is.

Expand|Select|Wrap|Line Numbers
  1. String Colours[] = {"Red", Yellow", "Grun"};
  2.  
  3. Map<String, Object> Lampz = new Map<String, Object>();
  4. Lampz.put("Red", "<object for Red here>");
  5. Lampz.put("Yellow", "<object for Yellow here>");
  6. Lampz.put("Grun", "<object for Grun here>");
  7.  
Cheers!
Oralloy
Oct 8 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Brigitte Behrmann | last post by:
Hi There This is my first time on the site. I am studing information technology and one of my subjects is HTML & Javascript. I am battling and have an assignment due, please help! I need to use...
2
by: juvilan | last post by:
I need a code for my thesis and I don’t know how to create a VB code for the traffic light.
8
by: razer | last post by:
Hi everybody I'm making a project where i need to make a simulation of a traffic light. The cars appear randomly, and are represented by letter, the traffic light stays open for x seconds, then...
5
by: =?Utf-8?B?QXlrdXQgRXJnaW4=?= | last post by:
Hi Willy, Thank you very much for your work. C++ code doesnot make any serialization. So at runtime C# code gives an serialization error at "msg_file_s sa = (msg_file_s) bf.Deserialize(ms);"...
0
by: anusha sharma | last post by:
i have made a visual basic project for traffic light,all the 3 lights are working properly....i need to insert a timer alongwith them,which should decrement each step for specific light.....as soon...
2
by: harryred7 | last post by:
Hi Question- I am currently writing a VB program for a traffic light control system. It nothing too robust nor with any microprocessors/sensors. i am using a Timer to control when the lights...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.