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.
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.