Search:

Type: Posts; User: shad0wblade890

Search: Search took 0.36 seconds.

  1. Replies
    5
    Views
    160

    Re: need help with sorting

    here what it prints out:

    Word: Frequency:
    -------------------------------------------------
    old 1
    is 1
    mars 1
    bob 2
    name 1
    years 1
  2. Replies
    5
    Views
    160

    Re: need help with sorting

    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...
  3. Replies
    5
    Views
    160

    need help with sorting

    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;
  4. Replies
    4
    Views
    115

    Re: i get an error when i run it

    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...
  5. Replies
    4
    Views
    115

    Re: i get an error when i run it

    so the line is :

    for(int i=0; i< fn.size(); i++){

    however i beilieve i need that for the program.
  6. Replies
    4
    Views
    115

    i get an error when i run it

    import java.io.File;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.HashMap;
    import java.util.Scanner;



    public class WordCounter
    {
  7. Replies
    3
    Views
    168

    Re: word counter program

    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
  8. Replies
    3
    Views
    168

    word counter program

    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...
  9. Replies
    4
    Views
    177

    Re: need help

    The original code is:



    public class RecursiveFibonacci {

    public int fibonacci(int n) {
    int result;
    if (n == 1 || n == 2)
    result = 1;
  10. Replies
    4
    Views
    177

    Re: need help

    int[] intArray = new int[8];
    intArray[0] = 0;
    intArray[1] = 1;

    System.out.println("fibonacci["+(0)+"] = "+intArray[0]);
    ...
  11. Replies
    4
    Views
    177

    need help

    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;...
Results 1 to 11 of 11