Perusal and File Writing with Java

by Son Rokhaniawan Perdata, S.T | 12:03 AM in , |

A few days ago, my friend asks for to help her works PR its Programming. PR's problem terminologicals i am goodly difficult also, since I newbie in programming. Programming languages who may be utilized is C,C++, Java. And since i am java person, therefore I choose to utilize Java.hehe.. Since I really be intend to study Java language.

Problem PR is we make program who will read one input file “indata.txt”, one that meaty word which will at test do correspond to order, if accords therefore that diwrite will into one file “legalwords.txt”, conversely if incorrectly will at write into file “badwords.txt”. Among word one by another word in file “indata.txt” came to pieces by one tabulator, on my program, I utilize tabulator tab(\t). Order that is utilized for mengetest to say is

a. first syllable may not as numeral as.
b. say has less than 8 characters.
c. say just may lap over of letter (a..z, A..Z), number (0..9), atau simbol underscore(’_').

Since I newbie in Java,and was wonted utilizes it, requiring time rather long time to think up syntax syntax that is used. On progam I, its program path is as follows:

a. Make one BufferedReader for FileReader(”indata.txt”). Make PrintWritter for FileWriter legalwords.txt and badwords.txt.
b. Then by use of StringTokenizer to account word amount in file indata.txt.
c. After knows total token / says, therefore then with looping to check about word / token, what appropriate ruling or not.
d. Then afters is sorted, therefore word suitably at write goes to legalwords.txt, and unsuitably diwrite goes to badwords.txt

And this is result running programs my version:
1. Input File

Input File

2. Legal Words

Input File

3. Bad Words

Input File

On Compile NetBeans

Input File

And this following is source code programs what do I make. Its correction appeal if available fault.

DOWNLOAD


Related Posts by Categories



0 comments:

About Me

My photo
I am its person simple. Bad blood platitude. Directly az goes to aim target

Shoutbox