|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (11 bit)
Join Date: Aug 2003
Location: Silicon Valley
Posts: 1,512
|
Help me--java program
Hi
just took my APCS-A test, so im not really doing anything in class--figured id start up making a new program to keep myself busy. Its going to need to keep track of my daily eating and lifting and running stats. It needs to have a way to SAVE all of this stuff so that the information is still there when i start up the program. This might sound dumb, but wouldnt it all get erased after i exit the program (the stuff that will be input each day by the user). It also needs to have input which i am having trouble with. lastly i would like to have a way that the program knows what the date is, so that it can keep track when i enter stuff into it. I wasnt sure if there was a way for java to read from the system clock and do this. i know that java's random number generator works off of the system clock to generate ints and doubles but i was unsure of if there is a way to access this information directly so that i can use it to keep the dates in order and track progress. so basically 1.) need help finding a way to make sure the info isnt lost after being input by user 2.) need way for program to know what date it is. 3.) need to know how to get the input from the user. the AP java subset didnt cover this at all, since its kinda tough. also it might be nice to have a GUI, but i get the feeling that would require a ton of time and effort to get working right. thanks |
|
|
|
|
|
#2 |
|
Member (9 bit)
Join Date: Jan 2006
Posts: 343
|
A simple GUI does not require a lot of time to setup. It sounds like you just need a basic interface to enter a few parameters. For simplicity:
1.) Use the FileOutputStream class to write to a comma delimited file on your drive. 2.) Use the Calendar class to get the system date. 3.) After creating your textfields, use the textfield.getText() method to grab the user input from your GUI. if you choose not to use a GUI, in your main method use the args[] object to get the user's parameters from the CL: public static void main(String args[]) { Program.doThis(args[0]); Program.doThat(args[1]); } |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|