Question
Asked by:
JavaDummy25
JavaDummy25
Rating : No Rating
Questions Asked: 27
Tutorials Posted: 0
 

$5.00 OOP Java

  • From Computer-Science: General-CS
  • Closed, but you can still post tutorials
  • Due on Jul. 27, 2009
  • Asked on Jul. 24, 2009 at 09:51:34AM
Q:
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

 


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

$10.00 Java, BufferedReader & Writer, read text, reverse & wirte to file, absolute paths, NetBeans folder, ScreenShot, UseNotes

  • This tutorial was purchased 1 time and rated A+ by students like you.
  • Posted on Jul. 24, 2009 at 10:23:18AM
A:
Preview: ... // a null is returned when end of file reached:<br> if (line == null) {<br> break; // break out of the while() loop<br> }<br> System.out.print("\\\\n" + line);<br><br> // invoke method to reverse string:<br> line = new String(reverseString(line));<br> System.out.println(" ---> " + line);<br><br> // write it:<br> outStream.write(line, 0, line.length());<br> outStream.newLine();<br> } catch (Exception e) {<br> System.out.println(<br> e.toString());<br> }<br> ...

The full tutorial is about 1223 words long plus attachments and additional clarification.

Attachments:
RevNabsPath.java (3K) (Preview)
RevNabsPathScreenShot.JPG (51K) (Preview)
RevNabsPathUseNotes.txt (1K) (Preview)
RevNabsPathZipped.zip (57K)
Posted by:
 

$5.00 OPP java - Reverse Line using BufferReader and Writer

  • This tutorial hasn't been purchased yet.
  • Posted on Jul. 25, 2009 at 03:46:27AM
A:
Preview: ... ffer reader and writer in j ...

The full tutorial is about 26 words long plus attachments.

Attachments:
(0K)
Posted by:
tayunyang
tayunyang
Rating (5): A-
Questions Asked: 0
Tutorials Posted: 60, earned $93.92
 

$5.00 OOP Java

  • This tutorial hasn't been purchased yet.
  • Posted on Jul 26, 2009 at 4:39:21PM
A:
Preview: ... fer (str);<br> str1.reverse();<br><br> return str1.toString();<br> }<br> public static void main(String args[])<br> {<br> String strLine;<br> FileInputStream fstream;<br> DataInputStream in;<br> BufferedReader br;<br> File file;<br> Writer out;<br><br> try<br> {<br> ...

The full tutorial is about 494 words long plus attachments.

Attachments:
revFileStr.zip (13K)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty