I am writing code that translates a DNA sequence! The program imports a string called shortDNA (for example ATCGGA) and has to translate it (specifically to TAGCCT), but for some reason it gives the shortDNA string that it imports(in this case ATTCGGA)! what is wrong with my code?
for (int i = 0; i < shortDNA.length(); i++) {
char ch = shortDNA.charAt(i);
if (ch=='A'){
ch='T';
}
else if (ch=='T'){
ch='A';
}
else if (ch=='G'){
ch='C';
}
else if (ch=='C'){
ch='G';
}
}