Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with a Java assignment Write a program that reads in all lines from a file and saves each to an element in

I need help with a Java assignment

Write a program that reads in all lines from a file and saves each to an element in an array. The program should then print out the lines in reverse.

1. Create a class called Lab8.

2. To break up this problem, first write code that reads in the first line of the file. Use my sample file called haikuFun.txt under the Files tab.

3. When you have this working, modify your code to read in every line of the file. Assume the file will only ever have 6 lines. You should use breakpoint debugging to make sure each line is getting read in properly.

4. Next, modify your code to store each of the 6 lines into an array.

5. Lastly, modify your code to print the lines in reverse order to a file called reverse.txt.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

What is the primary role of advertising in IMC?

Answered: 1 week ago

Question

Create a corporate story for a company with which you are familiar.

Answered: 1 week ago

Question

Find examples of good corporate advertising.

Answered: 1 week ago