here what it prints out:
Word: Frequency:
-------------------------------------------------
old 1
is 1
mars 1
bob 2
name 1
years 1
Type: Posts; User: shad0wblade890
here what it prints out:
Word: Frequency:
-------------------------------------------------
old 1
is 1
mars 1
bob 2
name 1
years 1
sure,
it takes a txt file (in this case test-file.txt) and reads/prints it out also counts the freq. of the words in the txt (such as the word "bob" apperes 2 times). but i want it to be sorted...
I got 99% done just need help with sorting code.
It reads the text file that i added in the main class.
import java.util.ArrayList;
okey i figure out why is null, because fn doesnt have a value set. so i need to read the ttext file that i imported in to my project (just reads 1 letter like ...... A ) and prints how many times its...
so the line is :
for(int i=0; i< fn.size(); i++){
however i beilieve i need that for the program.
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;
public class WordCounter
{
done :) and i need help on the print method as you can see i left it blank because idk where to start. also i want to make sure that the code i did matches the instructions
INSTRUCTIONS
Create a WordCounter class with a constructor that takes a file name as a parameter
The class should have two fields: one for the file name and one for a HashMap to store word...
The original code is:
public class RecursiveFibonacci {
public int fibonacci(int n) {
int result;
if (n == 1 || n == 2)
result = 1;
int[] intArray = new int[8];
intArray[0] = 0;
intArray[1] = 1;
System.out.println("fibonacci["+(0)+"] = "+intArray[0]);
...
Hi, I need to change the program below to an "array" please help.
public class RecursiveFibonacci {
public int fibonacci(int n) {
int result;
if (n == 1 || n == 2)
result = 1;...