Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

//name of my program public class ProteinFinder{ //Strings are set up as One-dim

ID: 3649838 • Letter: #

Question

//name of my program
public class ProteinFinder{
//Strings are set up as One-dimensional array to be used by user
private static String[] nSequences = {"ATG", "GCA", "ACG", "TGA", "ATT", "TTT", "TAG", "TAA","TTA", "TTC", "TTG", "CTT", "CTC", "ATC", "ATA", "GTT", "GTC", "GTA", "GTG", "TCT", "TCC","TCA","TCG","CCT", "CCC","CCA","CCG","ACT","ACC","ACA","ACG","GCT","GCC","GCG","TAT","TAC","CAT","CAC","CAA", "CAG","AAT","AAC","AAA","AAG","GAT","GAC","GAA","GAG","TGT","TGC","TGG","CGT","CGC","CGA","CGG","AGT","AGC","AGA","AGG","GGT","GGC","GGA","GGG"}; //assign string to variable
//second word that shows after user input three letters
private static String [] nAminoAcids = {"Met", "Ala", "Thr", "STOP", "Ile", "Phe", "STOP", "STOP", "Leu", "Phe", "Leu", "Leu", "Leu", "Ile", "Ile", "Val", "Val", "Val", "Ser", "Ser", "Ser", "Ser", "Pro", "Pro", "Pro", "Pro", "Thr", "Thr", "Thr", "Ala", "Ala", "Ala", "Tyr", "His", "Gln", "Gln", "Asn", "Asn", "Lys", "Lys", "Asp", "Asp", "Glu", "Glu", "Cys", "Cys", "Trp", "Arg", "Arg", "Arg", "Ser", "Ser", "Arg", "Arg", "Gly", "Gly", "Gly", "Gly"};
//initiate string as proteins
private static int n;

public static String find(String dna){
dna.toUpperCase(); //convert the string into uppercase triplet letter
return dna;

// i want to use this loop to look through my string.
while(nSequences[n] != ("TGATAGTAA"));
for(int n1 = 0; n1 < 3; n1++){
int i;
if(dna.substring(i, i+3).equals( nAminoAcids[n1]))
nSequences += nAminoAcids[n1]; //operator has error
}
}

//new method
public static void main(String[] args){ //program needs to execute action
String result = find("ATGGCAACG");
System.out.println(result);
}
}

i need help fixing my while loop please so i can search for triple letters to display the word in static string AminoAcids. expert help

Explanation / Answer

import java.awt.*; // importing tools for program import javax.swing.*; import java.awt.event.*; import java.util.*; import java.io.*; //name of my program public class ProteinFinder{ //Strings are set up as One-dimensional array to be used by user private static String[] nSequences = {"ATG", "GCA", "ACG", "TGA", "ATT", "TTT", "TAG", "TAA","TTA", "TTC", "TTG", "CTT", "CTC", "ATC", "ATA", "GTT", "GTC", "GTA", "GTG", "TCT", "TCC","TCA","TCG","CCT", "CCC","CCA","CCG","ACT","ACC","ACA","ACG","GCT","GCC","GCG","TAT","TAC","CAT","CAC","CAA", "CAG","AAT","AAC","AAA","AAG","GAT","GAC","GAA","GAG","TGT","TGC","TGG","CGT","CGC","CGA","CGG","AGT","AGC","AGA","AGG","GGT","GGC","GGA","GGG"}; //assign string to variable //second word that shows after user input three letters private static String[] nAminoAcids = {"Met", "Ala", "Thr", "STOP", "Ile", "Phe", "STOP", "STOP", "Leu", "Phe", "Leu", "Leu", "Leu", "Ile", "Ile", "Val", "Val", "Val", "Ser", "Ser", "Ser", "Ser", "Pro", "Pro", "Pro", "Pro", "Thr", "Thr", "Thr", "Ala", "Ala", "Ala", "Tyr", "His", "Gln", "Gln", "Asn", "Asn", "Lys", "Lys", "Asp", "Asp", "Glu", "Glu", "Cys", "Cys", "Trp", "Arg", "Arg", "Arg", "Ser", "Ser", "Arg", "Arg", "Gly", "Gly", "Gly", "Gly"}; //initiate string as proteins private static int n; public static String find(String dna){ dna.toUpperCase(); //convert the string into uppercase triplet letter return dna; //error too int index = nSequences.indexOf("GCA"); if(index == nSequences.length) { return null; return nAminoAcids.subString(index+1,3); } //error too // i want to use this loop to look through my string. while(nSequences[n] != ("TGATAGTAA")); for(int n1 = 0; n1 < 3; n1++){ int i; if(dna.substring(i, i+3).equals( nAminoAcids[n1])) nSequences += nAminoAcids[n1]; //operator has error } } //new method public static void main(String[] args){ //program needs to execute action String result = find("ATGGCAACG"); System.out.println(result); } }