Question
Asked by:
Exera
Exera
Rating : No Rating
Questions Asked: 31
Tutorials Posted: 0
 

$25.00 Java application that reads data from an input file, processes the data, and then writes the processed data to an output

Q:
Really lost on this chapter of programming looking for someone to build a program for me which I can use as a layout to build my own for this week of homework.

In this project, you will design, develop, test, and document a Java application that reads data from an input file, processes the data, and then writes the processed data to an output file.
* The application should be run from the command line using command-line arguments to provide the input and output filenames.
* The application should display an appropriate error message if the user forgets to enter the input and output filenames at the command prompt or if the files are not found.
* The application should open the file and read each line of the file.
* For each line read, the application should determine the total number of characters in the line, including white-space characters, determine the number of times the number 4 appears in the line, replace all occurrences of the string with , and finally reverse the order of the characters in the line.
* The output file should contain the same number of lines as the input file with the following content for each line:
o total number of characters, including whitespace characters, in the line
o number of times the number 4 appeared in the line
o reversed string (for example, in the input file would be displayed as )

The items on each line in the output file should be separated by commas (for example: for input line , the output line should be )

* The application should close any open files before exiting.

(Please use remarks to explain which area's are of what. I have already built a program that has some of the following, but I am lost regarding the command line and the string variables. If you want a copy of my program just e-mail me and I will send it. But I prefer if you didn't use my own work, because I wish to submit my own work not someone else's.)
 


   
   
   
   
DoctorD asked: The assignment says: "replace all occurrences of the string with , " It appears something is missing. Can you clarify what text is to be replaced, and what is the replacement?
To which Exera said: replace all occurrences of the string "this" with "That" Sorry, didn't see that. Does this example of yours have all the following once you fix this? Thank you for the help.
 
Available Tutorials to this Question
Posted by:
DoctorD
DoctorD
Rating (9): A-
Questions Asked: 0
Tutorials Posted: 28, earned $420.43
 

$25.00 Java text file processor -does all features EXCEPT replacement

  • This tutorial was purchased 2 times and rated A- by students like you.
  • Posted on Dec 12, 2008 at 11:23:13PM
A:
Preview: ... <br>It performs various text processing operations<br>on each lin ...

The full tutorial is about 44 words long plus attachments.

Attachments:
TextProcessor.java (1K) (Preview)
Posted by:
nzpapillon
nzpapillon
Rating (255): A+
Questions Asked: 0
Tutorials Posted: 549, earned $4,988.47
 

$25.00 Robust Java file processor, sample input file, sample output file

  • This tutorial was purchased 4 times and rated A- by students like you.
  • Posted on Dec 12, 2008 at 7:21:47PM
A:
Preview: ... ile<br> outFile.println(numChars + "," + foursCount +"," + reverse(newString).toString());<br> foursCount = 0; //reset tallying of numbe ...

The full tutorial is about 184 words long plus attachments.

Attachments:
JavaFileProcessor.java (2K) (Preview)
FileProcessorInputFile.txt (0K) (Preview)
FileProcessorOutputFile.txt (0K) (Preview)
Posted by:
grizk
grizk
Rating (21): A+
Questions Asked: 0
Tutorials Posted: 90, earned $427.70
 

$25.00 The Perfect Solution with java.io and java.util.regex

  • This tutorial hasn't been purchased yet.
  • Posted on Dec. 13, 2008 at 12:44:04AM
A:
Preview: ... h - 1;<br> str = "";<br> for (m=len; m > -1; m--){<br> num4 = 0;<br> try {<br> num4 = Integer.parseInt(chars[m]);<br> }catch(NumberFormatException nfe) {<br> ;<br> }<br> if(num4==4){<br> ++len4; <br> }<br> str += chars[m];<br> }<br> lines += len+","+len4+","+str+ ...

The full tutorial is about 1068 words long .
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty