wood burning stoves 2.0*
The moose likes Certification Results and the fly likes HAHA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Certification Results
Bookmark "HAHA" Watch "HAHA" New topic
Author

HAHA

kerwin john abrinica
Greenhorn

Joined: Jan 15, 2012
Posts: 5
import java.lang.*;
import java.io.*;
import java.util.StringTokenizer;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class WordCount
{
public static void main (String [] args)throws IOException
{
FileReader fr = new FileReader("wordCount_input.txt");
FileWriter fw = new FileWriter("wordCount_output.txt");
BufferedReader lolo = new BufferedReader(fr);
String s = lolo.readLine();
int tokenCount;

Double nono;

StringTokenizer st = new StringTokenizer(s);
tokenCount = st.countTokens();

System.out.println("Number of tokens = " + tokenCount );



}


public static void s(String roro){
while (st.hasMoreTokens()){

System.out.println();
while(st.hasMoreElements()){
StringTokenizer zt = new StringTokenizer(s);
int tokenCount1 = zt.countTokens()/zt.countTokens();
double tokenCount2 = zt.countTokens()/zt.countTokens();
NumberFormat formatter = new DecimalFormat("#0.00");
nono = tokenCount2 / tokenCount;

System.out.println( "\t\t" + tokenCount1 + "\t" + formatter.format(nono));
fw.write("\r\t\t" + tokenCount1 + "\t" + formatter.format(nono));
break;
}

// fr.close();
// fw.close();



}

}

}
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Please UseAMeaningfulSubjectLine and UseCodeTags. Why have you posted in Certification Results forum with subject line "HAHA"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HAHA