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...
Type: Posts; User: helloworld922
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...
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.
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...
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
...
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,...