| | |
Please help
![]() |
•
•
Join Date: Dec 2008
Posts: 3
Reputation:
Solved Threads: 0
It is my final assinment to create a program similar to yahtzee. I need it to roll 6 dice visually. Allow the user to keep the dice they want to save. And after three rolls select a place to save their number value. At end of program, it should tally up total score and display. I have been reading on interent for around a week, going over Dan Siedman's work, Reading my textbook, researching other works over arrays, but i have come to the conclusion that I am bogged down, and dont have a clue what to do. I have 5 days left to finish up the program, Ive flowcharted what it needs to do, I started the code like 5 times and scrapped it, asked around to fellow students(who are also not going to finish the project imo, theres only 5 of us)I am not a strong programmer by nature, I did very well in cobol and vb, I finished out c++ by a hair, and java is like reading heiroglyphics basically to me. I read and re-read the chapters, but it just doesnt click. My textbook we use is supposedly not a very good one(Java Programming: complete Concepts and Techniques, only over chapters 1-6) My idea that im stuck at is as follows for those who are still reading
1. Create the dice(I still havent figured out how to visually make six dice, dice[5])
2. Make a button that rolls the dice using math.random
3. Store the dice in an array(scores[6])
3. Have six textfields with labels next to them that read 1's, 2's, ect.
where the user can click to save the dice total, place in the scores [5] array.
4. A total score textfield(scores[6]) that after all previous scores have been recorded shows the total of all scores.
5. A "play again" button that repaints the progrom to blank
6. an exit button that closes the program
If someone could help me out, I would be greatful. I have no problem in doing the work, but I am completly defeated and in a best case scenario if i could pull my grade in his class from a 68 to at least passing, I would be doing very well. I have discovered that I do not want to be a programmer(kinda late for that now lol) but with financial descions and me almost being finished I am stuck with this degree plan. My real passion is for fixing computer problems either hardware related or software related, and I imagine I can get a job in IT somewhere if i can finish my degree. (my school has jobs opening up and I am in the process of trying to land one) thanks for reading
1. Create the dice(I still havent figured out how to visually make six dice, dice[5])
2. Make a button that rolls the dice using math.random
3. Store the dice in an array(scores[6])
3. Have six textfields with labels next to them that read 1's, 2's, ect.
where the user can click to save the dice total, place in the scores [5] array.
4. A total score textfield(scores[6]) that after all previous scores have been recorded shows the total of all scores.
5. A "play again" button that repaints the progrom to blank
6. an exit button that closes the program
If someone could help me out, I would be greatful. I have no problem in doing the work, but I am completly defeated and in a best case scenario if i could pull my grade in his class from a 68 to at least passing, I would be doing very well. I have discovered that I do not want to be a programmer(kinda late for that now lol) but with financial descions and me almost being finished I am stuck with this degree plan. My real passion is for fixing computer problems either hardware related or software related, and I imagine I can get a job in IT somewhere if i can finish my degree. (my school has jobs opening up and I am in the process of trying to land one) thanks for reading
•
•
Join Date: Oct 2007
Posts: 25
Reputation:
Solved Threads: 1
That's a fairly advanced project for someone new to Java. But I do have a suggestion to help get you going...
It sounds like this app requires a GUI. I would suggest you build the GUI first... forget about the logic for the dice, etc for now. First build the GUI with the buttons you need. That alone will probably get you half credit.
Once you have the GUI you will, for the most part, have much of your logic (including dice logic) in your Action Listener code. When someone clicks a button the Action Listener code will be called. You can find out more about Action Listeners here...
http://java.sun.com/docs/books/tutor...nlistener.html
I also suggest using the Math.random method for your dice rolls.
Hope this helps!
Tyster
It sounds like this app requires a GUI. I would suggest you build the GUI first... forget about the logic for the dice, etc for now. First build the GUI with the buttons you need. That alone will probably get you half credit.
Once you have the GUI you will, for the most part, have much of your logic (including dice logic) in your Action Listener code. When someone clicks a button the Action Listener code will be called. You can find out more about Action Listeners here...
http://java.sun.com/docs/books/tutor...nlistener.html
I also suggest using the Math.random method for your dice rolls.
Hope this helps!
Tyster
•
•
Join Date: Nov 2008
Posts: 33
Reputation:
Solved Threads: 2
There are a few URLs: These will help your project.
http://math.hws.edu/javanotes/c6/ex4-ans.html
http://www.csd.abdn.ac.uk/~etadjoud/...roll_dice.html
http://www.antionline.com/archive/in.../t-228926.html
Albert
http://math.hws.edu/javanotes/c6/ex4-ans.html
http://www.csd.abdn.ac.uk/~etadjoud/...roll_dice.html
http://www.antionline.com/archive/in.../t-228926.html
Albert
•
•
•
•
There are a few URLs: These will help your project.
http://math.hws.edu/javanotes/c6/ex4-ans.html
http://www.csd.abdn.ac.uk/~etadjoud/...roll_dice.html
http://www.antionline.com/archive/in.../t-228926.html
Albert
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
![]() |
Other Threads in the Java Forum
- Previous Thread: multiple clients conect to UDP server
- Next Thread: pls clear doubt
| Thread Tools | Search this Thread |
911 addball addressbook android api append applet application apps array arrays automation binary bluetooth businessintelligence button card chat class client code collision component crashcourse css csv database eclipse ee error fractal free game gis givemetehcodez graphics gui html ide image integer integration j2me japplet java javaarraylist javadoc javafx javaprojects jni jpanel julia jvm linux list loan machine map method methods migrate mobile netbeans newbie objects oriented output panel phone physics problem program programming project projects radio recursion replaydirector reporting scanner se server service set sms socket software sort sql string swing test textfield threads transfer tree trolltech ubuntu utility windows





