The Artima Developer Community
Sponsored Link

Design Forum
please i need help

1 reply on 1 page. Most recent reply: Sep 3, 2003 4:33 PM by Bill Burris

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
mohend

Posts: 3
Nickname: mohe
Registered: Sep, 2003

please i need help Posted: Sep 1, 2003 7:34 PM
Reply to this message Reply
Advertisement
i have this program to do.
i am new to java, if you could please help me.
the program is:

Text Line Display Utility: Given the name of a text file, and a target line number, display the five lines immediately preceding the target line, the target line, and the five following lines. Stay in a loop that prompts for a new target line number or 'quit' (e.g., a target line number of '0' can be used to exit the loop). Enhancement: use a prompted variable to control the number of lines displayed before and after.


Bill Burris

Posts: 24
Nickname: billburris
Registered: Aug, 2003

Re: please i need help Posted: Sep 3, 2003 4:33 PM
Reply to this message Reply
Split your problem up into pieces and see if you can do one piece at a time.

The best way is to use a unit testing tool like JUnit. Write a test, then write the code needed to make the test pass. Repeat the process, test then code, until you have all the pieces that you need. Then do the user interface.

Find out how to enter a filename.
Find out how to open a file.
Find out how to read from a file.
Are your files small?
Can you read the whole file in at once?
Can you read the file one line at a time?

Start asking yourself questions, and see if you can answer them one at a time. A unit test is JUnit is a good way to ask a question.

Bill

Flat View: This topic has 1 reply on 1 page
Topic: Singelton & JUnit tests Previous Topic   Next Topic Topic: Is this a design pattern?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use