█ HostDens : WordPress Hosting | Beyond Your Expectation █
wRick - Today, 04:32 PM
Recent Blog Entries
Recent Status Updates
When faced with a wall of errors and no hope to fix them, remember the following "Programs always do what you tell them to, and seldom what you want them to, but eventually you'll run out of things that can go wrong and it'll just work. and that's the secret to good programming."Show comments (2)
- Managed C++
- Visual Basic 4 / 5 / 6
- linked list
- hello world
Posted 12 April 2012 - 09:29 AM
So anyways here's my problem; I want to create a basic poll.
For example -
Question - Which country out of the four would you want to go on holiday too?
Responses USA, Thailand, Greece, Italy
So basically what I'm trying to implement is when the program starts it will display an initial menu screen with the following set of options:
1. Display the current score for each possible response.
3. Quit the program.
Display an error message if an invalid response is entered.
If the user selects option two, the program will display the question and the four possible responses. The user will then enter a response and the response will be recorded in the program. Again display an error message if the response is invalid.
The thing I'm trying to do is create one class with the following data:
Four possible responses
The current score for each response
It should contain the following methods:
A setter and getter for the survey question
Setters and getters for each of the responses
addVotes, which will add one to the score for the specified response.
It's been years since I've last done java and I really need some help, if anyone can point in the right way with the coding that would be great.
I am using Jedit for the coding.
Posted 12 April 2012 - 10:47 AM
Secondly, and this isn't really related to programming but rather to data collection, but have you considered not revealing the current poll statistics until after the user has made their choice? The reason is because seeing the current poll statistics before a choice is made may influence the user's decision making, whereas polls are intended to get the user's unbiased response. This is typically how online polls are conducted. (The results aren't shown until after a selection is made.)
Lastly, what do you have so far? There are many different ways to approach this, some good, some not so good. We would have to see your progress so far in order to give helpful advice.
Even more lastly, this probably would get more responses if it were posted in the Java help forum.
Posted 12 April 2012 - 12:01 PM
I can do basic coding but I'm totally lost on this occasion; and yes I understand your view on seeing the statistics after the user has voted but I want to keep it basic it for now.
I'll post this on the Java help forum too I guess.
Posted 12 April 2012 - 12:49 PM
Aside from programming, what sort of planning steps have you taken so far? A project like this should begin with the conceptual planning before you ever get to coding.
These are the types of questions you need to answer before you can know how to move ahead: How do you plan on delivering this software? (Applet in browser? Downloadable program? Mobile app?) Will it have a GUI? What will the GUI look like? (Draw it out.) What will you use for your data-storage backend? (Database? flat files?) How will you host the backend? (Your own server vs. Hosted services such as JSP/Tomcat/Glassfish)
Once you have your design nailed down, we can begin to talk about how to code it.
Posted 12 April 2012 - 01:11 PM
Firstly, I would recommend using a better IDE to do your coding instead of JEdit. Netbeans and Eclipse are the two most popular ones, and are very good.
Just a note: jEdit has some very powerful features (I use it regularly for it's RegEx support). If you're doing GUI development, however, it's probably not your best choice.
My MineCraft server site: http://banishedwings.enjin.com/