Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Note: This is a File I/O question done using Java please . You have the following text files: bkp.txt AND file1.txt: bkp.txt: File owner: David

Note: This is a File I/O question done using Java please. You have the following text files: bkp.txt AND file1.txt:

bkp.txt:

File owner: David Pellegrini, GreatestTA

The following is the entire script of The Bee Movie. People much better than me wrote it. I simply copied it from http://www.script-o-rama.com/movie_scripts/a1/bee-movie-script-transcript-seinfeld.html

According to all known laws of aviation,

there is no way a bee should be able to fly.

Its wings are too small to get its fat little body off the ground.

The bee, of course, flies anyway

because bees don't care what humans think is impossible.

Yellow, black. Yellow, black. Yellow, black. Yellow, black.

Ooh, black and yellow! Let's shake it up a little.

Barry! Breakfast is ready!

Ooming!

Hang on a second.

Hello?

- Barry? - Adam?

- Oan you believe this is happening? - I can't. I'll pick you up.

Looking sharp.

Use the stairs. Your father paid good money for those.

Sorry. I'm excited.

Here's the graduate. We're very proud of you, son.

A perfect report card, all B's.

Very proud.

Now you have the file1.txt:

File owner: David Pellegrini, GreatestTA

The following is the entire script of The Bee Movie. People much better than me wrote it. I simply copied it from http://www.script-o-rama.com/movie_scripts/a1/bee-movie-script-transcript-seinfeld.html

According to all known laws of aviation,

there is no way a bee should be able to fly.

Its wings are too small to get its fat little body off the ground.

The bee, of course, flies anyway

because bees don't care what humans think is impossible.

Yellow, black. Yellow, black. Yellow, black. Yellow, black.

Ooh, black and yellow! Let's shake it up a little.

Barry! Breakfast is ready!

Ooming!

Hang on a second.

Hello?

- Barry? - Adam?

- Oan you believe this is happening? - I can't. I'll pick you up.

Looking sharp.

Use the stairs. Your father paid good money for those.

Sorry. I'm excited.

Here's the graduate. We're very proud of you, son.

A perfect report card, all B's.

Very proud.

Yes, I can see that they are the same files with the same text, but you will see a use for it later on. Do the following in Java using File I/O:

1) Open file1.txt. Print every 4th line (including line number 1). Make sure that the code can be adjusted to print every 3rd line as well as every 2nd line. 2) Print the owner of the file (Hint: it's David and the information is on line 2

3) Create file2.txt. Write your name and the name of your first car. Make sure that the code can be adjusted to change the something about you. For example, if I say write your name and the name of your first cat, it should work.

4) Append (add) your name to file1.txt. If you made a mistake open bkp.txt and copy the original back in

Thanks for all your help!

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

Nested Relations And Complex Objects In Databases Lncs 361

Authors: Serge Abiteboul ,Patrick C. Fischer ,Hans-Jorg Schek

1st Edition

ISBN: 3540511717, 978-3540511717

More Books

Students also viewed these Databases questions