Answer to Question #2220 in Java | JSP | JSF for michael

Question #2220
I need to simplify the letter count and add scaling to the word bar char a i have the array set to 12 but it needs to read a file and then produce the amount of frequency and length in that particular file
import java.io.*;
import java.util.*;

class WordCount
{
public static void main(String[] args) throws IOException
{
FileReader file = new FileReader("new.txt");
BufferedReader MyFile = new BufferedReader(file);

StringTokenizer TokenizeMe= new StringTokenizer("");
int NumberOfTokens = 0;
int NumberOfWords = 0;
char barchart = '#';
char[] letters = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J','K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};


int frequency [] = new int [12];
// frequency [] stores number of words of length
int a;
String line="";

while((line=MyFile.readLine())!=null)
{
System.out.println("Processing line="+
1
Expert's answer
2011-04-01T11:03:31-0400
Submit your requirements as an assignment to our control panel set the deadline and our experts will assist you.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS