0
import java.util.*;

public class Homework11 {

Scanner input = new Scanner(new File("keyvalues.txt"));
Map<String, Integer> wordCountMap = getCountMap(in);

	for (String word: wordCountMap.keySet()) {
		int count = wordCountMap.get(word);
		
 while (input.hasNextLine()) {
	 	line = input.nextLine();
		numLine++;
	 	Scanner word = new Scanner(line);
		while (word.hasNext()){
			String nextWord = word.next();
			numWord++;
			numChar = numChar + nextWord.length();
		}

if (wordCountMap.containsKey(name)) {
	double word = wordCountMap.get(name);
	System.out.println(name + "'keyword is $" );
} else {
	System.out.prinln("that wont work " + name);
			}
		}
	}
}

just have a problem with for (String word: wordCountMap.keySet()) {
i hope thats it

Edited by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by jwenting
0

Use code tags and give better information. What do you mean you "hope that's it"? It is relatively easy to pinpoint a problem to a section of code. Did the code before that point execute properly? Did the code after it ever execute at all?

0

Use code tags and give better information. What do you mean you "hope that's it"? It is relatively easy to pinpoint a problem to a section of code. Did the code before that point execute properly? Did the code after it ever execute at all?

yeah correct... code will never compile..
I think it is not a full code...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.