Search:

Type: Posts; User: helloworld922

Search: Search took 0.13 seconds.

  1. Replies
    11
    Views
    2,589

    Re: User Defined Methods

    You have a pre-mature return statement. remove the return (((double)count)/str2.length());

    Also, I think you wanted to check if it matched by atleast that percentage, right?

    If so, you need to...
  2. Replies
    11
    Views
    2,589

    Re: User Defined Methods

    err... oops. The return ((double)count)/str2.length(); should be the percentage of common letters between str1 and str2. Just compare that with N and return true or false appropriately.
  3. Replies
    11
    Views
    2,589

    Re: User Defined Methods

    Oh wow, haha that's the wrong topic to be posting that in. For some reason I thought this was your other topic about substrings :)

    So the letters in str2 can appear anywhere in str1?


    for (int...
  4. Replies
    11
    Views
    2,589

    Re: User Defined Methods

    for(int i = 0; i < str1.length(); i++)
    {
    for (int j= 0; j < str2.length();j++)
    {
    if (i+j >= str1.length())
    {
    // test wrap-around bit
    ...
  5. Replies
    11
    Views
    2,589

    Re: User Defined Methods

    I think it's a typo, but you need to declare int data types lower case, and there is a missing space. Also, general convention in java is to name variables/methods starting with lower case letters,...
Results 1 to 5 of 5