I have some errors in my code and can't figure out how to get rid of them any help is wonderful.

The full code is:

import java.util.Scanner;

public class FindGeneSequence2 
{
    public static void main(String[] args) 
    {
        Scanner input = new Scanner(System.in);
        System.out.println("Please enter a genome for segmentaion into genes: ");
        String Genome = input.nextLine();
        System.out.println("The genome you entered is: " + Genome);
        int ATG = 0;
        while(true) 
        {
            ATG = FindBegingMarker(Genome, ATG);
            System.out.println("ATG is found at loction " + ATG);

            if (ATG = -1)
            {
                break;
                int end = FindEndingMarker(Genome, ATG+3);
                System.out.println("End = " +end);
                    if (end > 0)
                    {
                        String Gene = Genome.substring(ATG + 3, end);
                        System.out.println("A possible gene is " + gene);
                        if(IsAGene(Gene))
                        System.out.println(Gene + " is a gene!");
                    }
                else
                System.out.println("No ending marker has been found. ");
                atg = 3;
            }           
        }

public static int FindBegingMarker (String "Genome", int begin)
{
    return Genome.indexOf("ATG", begin);
}

public static int FindEndingMarker (String "Genome", int begin)
{
    int tag = Genome.indexOf("TAG", begin);
    int taa = Genome.indexOf("TAA", begin);
    int tga = Genome.indexOf("TGA", begin);
    int min = begin;

    if (tag > 0)
        min = tag;
    if (taa > 0)
        if (min > begin)
            min = (taa < min)? taa : min;
        else
            min = taa;
    if (tga > 0)
        if (min > begin)
            min = (tga < min)? tga : min;
        else
            min = tga;
    return (min == begin)? -1 : min;
}

public static boolean IsAGene(String "Gene")
{
    if(
        Gene.indexOf("ATG") >= 0 ||
        Gene.indexOf("TAG") >= 0 ||
        Gene.indexOf("TAA") >= 0 ||
        Gene.indexOf("TGA") >= 0 
        )
        return false;
    if (Gene.length() >= 3 && Gene.length() %3 ==0)
        return true;
    else
        return false;
}
}

The errors I recieve are:

 ----jGRASP exec: javac -g FindGeneSequence2.java

FindGeneSequence2.java:35: error: illegal start of expression
public static int FindBegingMarker (String "Genome", int begin)
^
FindGeneSequence2.java:35: error: illegal start of expression
public static int FindBegingMarker (String "Genome", int begin)
       ^
FindGeneSequence2.java:35: error: ';' expected
public static int FindBegingMarker (String "Genome", int begin)
             ^
FindGeneSequence2.java:35: error: ')' expected
public static int FindBegingMarker (String "Genome", int begin)
                                          ^
FindGeneSequence2.java:35: error: illegal start of expression
public static int FindBegingMarker (String "Genome", int begin)
                                                   ^
FindGeneSequence2.java:35: error: ';' expected
public static int FindBegingMarker (String "Genome", int begin)
                                                    ^
FindGeneSequence2.java:35: error: not a statement
public static int FindBegingMarker (String "Genome", int begin)
                                                         ^
FindGeneSequence2.java:35: error: ';' expected
public static int FindBegingMarker (String "Genome", int begin)
                                                              ^
FindGeneSequence2.java:40: error: illegal start of expression
public static int FindEndingMarker (String "Genome", int begin)
^
FindGeneSequence2.java:40: error: illegal start of expression
public static int FindEndingMarker (String "Genome", int begin)
       ^
FindGeneSequence2.java:40: error: ';' expected
public static int FindEndingMarker (String "Genome", int begin)
             ^
FindGeneSequence2.java:40: error: ')' expected
public static int FindEndingMarker (String "Genome", int begin)
                                          ^
FindGeneSequence2.java:40: error: illegal start of expression
public static int FindEndingMarker (String "Genome", int begin)
                                                   ^
FindGeneSequence2.java:40: error: ';' expected
public static int FindEndingMarker (String "Genome", int begin)
                                                    ^
FindGeneSequence2.java:40: error: not a statement
public static int FindEndingMarker (String "Genome", int begin)
                                                         ^
FindGeneSequence2.java:40: error: ';' expected
public static int FindEndingMarker (String "Genome", int begin)
                                                              ^
FindGeneSequence2.java:62: error: illegal start of expression
public static boolean IsAGene(String "Gene")
^
FindGeneSequence2.java:62: error: illegal start of expression
public static boolean IsAGene(String "Gene")
       ^
FindGeneSequence2.java:62: error: ';' expected
public static boolean IsAGene(String "Gene")
             ^
FindGeneSequence2.java:62: error: ')' expected
public static boolean IsAGene(String "Gene")
                                    ^
FindGeneSequence2.java:62: error: illegal start of expression
public static boolean IsAGene(String "Gene")
                                           ^
FindGeneSequence2.java:62: error: ';' expected
public static boolean IsAGene(String "Gene")
                                            ^
22 errors

 ----jGRASP wedge2: exit code for process is 1.
 ----jGRASP: operation complete.
public static int FindBegingMarker (String Genome, int begin)//line 36 variable name should not be enclosed by double quotes.
public static int FindEndingMarker (String abc, int begin)//line 42 variable name should not be enclosed by double quotes.
public static boolean IsAGene(String Gene)//line 63 variable name should not be enclosed by double quotes.
 if (ATG == -1)//you cannot typecast from int to boolean.It should be == operator not assignment(=) operator
  System.out.println("A possible gene is " + Gene);//line 26.variables are case sensitive
   ATG = 3;//line 32.variables are case sensitive

 //break; i have not checked your code working but why are you breaking in the first line of if.because all code below break will be ignored.
 }//add on line 35

@IIM the changes fixed my errors but now my code runs continuously ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.