• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating a Program that Can Write to a File From User Input  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to:
Create a Program that Can Write to a File From User Input. Then After a Period of 3 Minutes- The program should display the contents of that file. After Five Minutes it should tell the user to log off.

Things I was told to look for:

user input from the command line
write to a text file

create a timer in java

read a text file and display on the screen

-Do you have any suggestions on how I should get about doing this?

Thank you
 
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
uhmmm.... the hints you've got are pretty good. So why don't you check

- user input from the command line
- write to a text file
- create a timer in java
- read a text file and display on the screen


Where are you stuck ? What have you tried so far ? Whats's the Exception you are seeing ? What is it the compiler keeps complaining ?


Pascal
 
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, the Ranch works really well when you can post a short chunk of code that almost works. We like to give good hints but make you do all the real work.

Pick one tiny bit of your problem and see what you can do with it. Maybe start with reading user input from the console. Read the JavaDoc on System and its "in" field. That's the console input. Study up on BufferedReader, too, so you can read a line at a time. When all that seems too confusing, Google for examples. Have fun!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!