Originally Posted by
nickerb2k
So I cant seem to remember how to do this so hopoe fully someone on here will
import java.io.*;
import java.util.*;
public class relearn{
public static void main( String args[] )
{
Scanner kbReader = new Scanner(System.in);
System.out.println("Enter the nucleotide sequence below: "); //Enter One Two
String AA = kbReader.nextLine( );
int AL = AA.length();
int x;
for( x=0; x<AL; x++){
if(AA.equals("a")||AA.equals("A")){
System.out.print("U");
}
else if(AA.equalsIgnoreCase("T")){
System.out.print("A");
}
else if(AA.equalsIgnoreCase("C")){
System.out.print("G");
}
else if(AA.equalsIgnoreCase("G")){
System.out.print("C");
}
}
}
}
heres my code what I need it to do is when ever I put in " ATCGTC" I need it to output "UAGCAG" but when I type in more that one letter is just ends the program
This is not the proper logic ..
please think differently..
insted of checking char with the string ..
make that string to char array and then check each char.
make use of toCharArray().