Question
Asked by:
missprince
missprince
Rating : No Rating
Questions Asked: 6
Tutorials Posted: 0
 

$10.00 Need more than a main....again.

Q:

I have the code correct code for this but unforutnately need separate files for this as well because my teacher wants good OOP prinicples.

 

Using BufferedReader class and BufferedWriter class, develop an application that reads lines of text from a file. Reverse each line of text and write to different text file named outfile.txt. Finally, have your application use the appropriate method on the File class to return the absolute path of the outfile.txt file and output the path to the screen.

Example input text file to be reversed:

This is line 1! This is line 2! This is line 3! This is line 4!

Example output text file after original is reversed:

!1 enil si sihT !2 enil si sihT !3 enil si sihT !4 enil si sihT

 
Attachments:
2009-07-23_023452_FileReverser.zip (12K)


   
   
   
   
 
Available Tutorials to this Question
Posted by:
smd777
smd777
Rating (6): A+
Questions Asked: 0
Tutorials Posted: 94, earned $165.44
 

$7.50 Separate Files OOP Principles Compiled and Tested Successfully

  • This tutorial hasn't been purchased yet.
  • Posted on Oct 18, 2009 at 2:38:29PM
A:
Preview: ... tached the source code. I made an InputFile class that opens the file ...

The full tutorial is about 46 words long plus attachments.

Attachments:
src.zip (1K) 

 InputFile.java
 Main.java
 ]

Posted by:
 

$9.00 Modified File Reverse Program - In Good OOP and Commented

  • This tutorial hasn't been purchased yet.
  • Posted on Oct 19, 2009 at 03:10:34PM
A:
Preview: ... ood OOP principles. The files are sepe ...

The full tutorial is about 33 words long plus attachments.

Attachments:
2009-07-23_023452_FileReverser.zip (17K) 

 2009-07-23_023452_FileReverser/FileReverser/build/classes/filereverser/Main.class
 2009-07-23_023452_FileReverser/FileReverser/build.xml
 2009-07-23_023452_FileReverser/FileReverser/manifest.mf
 2009-07-23_023452_FileReverser/FileReverser/nbproject/build-impl.xml
 2009-07-23_023452_FileReverser/FileReverser/nbproject/genfiles.properties
 2009-07-23_023452_FileReverser/FileReverser/nbproject/private/private.properties
 2009-07-23_023452_FileReverser/FileReverser/nbproject/project.properties
 2009-07-23_023452_FileReverser/FileReverser/nbproject/project.xml
 2009-07-23_023452_FileReverser/FileReverser/outfile.txt
 2009-07-23_023452_FileReverser/FileReverser/sample.txt
 2009-07-23_023452_FileReverser/FileReverser/src/filereverser/filereverser/Files.class
 2009-07-23_023452_FileReverser/FileReverser/src/filereverser/filereverser/Main.class
 2009-07-23_023452_FileReverser/FileReverser/src/filereverser/Files.java
 2009-07-23_023452_FileReverser/FileReverser/src/filereverser/Main.java
 2009-07-23_023452_FileReverser/FileReverser/src/filereverser/openFile.java
 ]

Posted by:
 

$8.00 Completed Java File Reader and Writer - A + sure

  • This tutorial hasn't been purchased yet.
  • Posted on Oct 19, 2009 at 03:59:22PM
A:
Preview: ... ou requir ...

The full tutorial is about 7 words long plus attachments.

Attachments:
src.zip (3K) 

 src/filereverser/filereverser/Files.class
 src/filereverser/filereverser/Main.class
 src/filereverser/Files.java
 src/filereverser/Main.java
 src/filereverser/openFile.java
 ]

Posted by:
modulo51
modulo51
Rating (110): A-
Questions Asked: 1
Tutorials Posted: 353, earned $2,117.64
 

$10.00 Java: 2 classes, read file, revese write text, show absolute file paths, NetBeans folder, UseNotes, ScreenShot

  • This tutorial was purchased 1 time and rated A+ by students like you.
  • Posted on Oct 20, 2009 at 10:06:03PM
A:
Preview: ... new BufferedReader(new FileReader(inFileName));                 // Creates a file writer to write data to the output file                 outputFile = new File(outFileName);                 fileWriter = new BufferedWriter(new FileWriter(outputFile));                 return true;             } catch (Exception e) {                 System.out.println(                         "An exception was thrown: " e.toString());                 System.out.print("Do you want to try again (Y or N): ");                 if (kb.nextLine().trim().equalsIgnoreCase("n")) {                     return false;                 }             }         }     }     // Reverses each line from the input file and writes it to output file     public static void readAndReverseText() throws IOException {         ...

The full tutorial is about 410 words long plus attachments.

Attachments:
FileManip.java (2K) (Preview)
FileManipulationUseNotes.txt (1K) (Preview)
FileMainpulationScreenShot.jpg (99K) (Preview)
FileManipulationZipped.zip (22K) 

 FileManipulationZipped/FileManipScreenShot.html
 FileManipulationZipped/FileManipScreenShot.txt
 FileManipulationZipped/FileManipulation/build.xml
 FileManipulationZipped/FileManipulation/build/classes/filereverser/FileManip.class
 FileManipulationZipped/FileManipulation/build/classes/filereverser/FileManipDriver.class
 FileManipulationZipped/FileManipulation/dist/FileManipulation.jar
 FileManipulationZipped/FileManipulation/dist/README.TXT
 FileManipulationZipped/FileManipulation/manifest.mf
 FileManipulationZipped/FileManipulation/nbproject/build-impl.xml
 FileManipulationZipped/FileManipulation/nbproject/genfiles.properties
 FileManipulationZipped/FileManipulation/nbproject/private/config.properties
 FileManipulationZipped/FileManipulation/nbproject/private/private.properties
 FileManipulationZipped/FileManipulation/nbproject/private/private.xml
 FileManipulationZipped/FileManipulation/nbproject/project.properties
 FileManipulationZipped/FileManipulation/nbproject/project.xml
 FileManipulationZipped/FileManipulation/sample.txt
 FileManipulationZipped/FileManipulation/src/filereverser/FileManip.java
 FileManipulationZipped/FileManipulation/src/filereverser/FileManipDriver.java
 FileManipulationZipped/FileManipulationUseNotes.txt
 FileManipulationZipped/outputFile
 ]

   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty