endcodon checks whether a string contains tagtaatga and get

endcodon checks whether a string contains “tag”“taa”“tga” and get the index of that “t”.
how do I correct this method
return i public int endcodon string new dna int i newdna. length newdna new dna String c new dna. substring i 3, i while i 2 &&! c. equals (\"tag\") && c. equals (\"taa\") && c. equals (\"tea\") f return i public string geteye color ring newdna String e new dna. substring (20, 21) mpiler Output totgatgccgcaggotgcctctgaga

Solution

public int endcodon(String newdna)
{
    int count = 0;
    int len = newdna.length();   

   for (int i = 0; i< len;i++)
    {
       count = count + 1;   
       if(newdna.charAt(i) == \'t\')
         {
           String c =newdna.substring(i,i+3);
        if(c.equals(\"tag\") || c.equals(\"taa\") || c.equals(\"tga\"))
         {
         return count;

         }

          }
  
    }
       
return 0;
}

endcodon checks whether a string contains “tag”“taa”“tga” and get the index of that “t”. how do I correct this method return i public int endcodon string new dn

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site