![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Newbie
Join Date: Apr 2008
Posts: 8
Rep Power: 0
![]() |
Re: New to programming and in over my head!
Sorry about the long delay in my response. Long story short Im now working on it in Java using the net beans IDE Freaky Chris suggested, thank you for that by the way.
As far as the basic logic for the program I was thinking: Variables: dice= thresh= again= gen=0 tally=0 num1 = (Math.Random()*10) + 1; add one to gen if num1 >= again add one to dice and one to tally else if num1 >= thresh add one to tally else if num1 <= thresh ignore until gen=dice display tally and thats that, I think that that basic flow of logic should work, its just a matter of putting it all into real code. If you notice any huge errors in my logic please let me know. Thank you, Cribbageman |
|
|
|
|
|
#12 |
|
Not a user?
Join Date: Sep 2007
Posts: 230
Rep Power: 1
![]() |
Re: New to programming and in over my head!
Well, try coding it and let us know if you get any errors; best way to find them is to run it.
Oh, and if I didn't tell you then another brother would, use CODE TAGS for any code you put here. Code tags look like # above the post editor. |
|
|
|
|
|
#13 |
|
Programmer
|
Re: New to programming and in over my head!
k, i don't know if you've solved the javac issue, but one way to do it is to remove it from the environment variable path, because if you hav more than one programmin language on your system, it wont be wise, i suggest you should open a folder on your c drive, in which u shd store your programs, remembering to save it with your classname.java. then on command prompt, type the following to compile nd run the program uv written
cd\ cd "The name of the folder on your c drive in which you saved your work" then set the path on cmd by typing the directory the jdk is in i.e set path=c:\programfiles\java\jdk.....\bin or rather c:\pr"click tab"\j"click tab"\j"tab"\b"tab" then enter. the tab completes the words for you. after that type javac, you should get a response. I hope this helps but if not use an ide, its better, but since you are new using notepad wont be a bad idea. success |
|
|
|
|
|
#14 |
|
Newbie
Join Date: Apr 2008
Posts: 8
Rep Power: 0
![]() |
Re: New to programming and in over my head!
OK, the code so far is...
java Syntax (Toggle Plain Text)
As you might be able to tell, I'm attempting to run this in a GUI, because Net Beans makes it very easy to do GUI work. i have for simplicities sake left the GUI code out. That being said, I was able to successfully compile the program, but when i attempted to run it, with variables in all necessary fields, the program lagged heavily and the error "java.lang.NullPointerException" popped up in the output dialog box in Net Beans. Any ideas are always welcome. Thank You, Cribbageman |
|
|
|
|
|
#15 |
|
Newbie
Join Date: Apr 2008
Posts: 8
Rep Power: 0
![]() |
Re: New to programming and in over my head!
Since I am now working in Java, I think it only appropriate to continue this in the Java side of the forums, Thank you all again for the advice and help so far.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|