Hello,
sorry for this easy question(I couldn't solve the problem using Java beginner's guide). I want my program to divide whatever number I input by three. However it keeps returning false answers. Unfortunatelly, I can't figure why. Firstly, this is the code:
class AnalyseADN{
public static void main(String args[])
throws java.io.IOException{
int n;
do{
n=(int)System.in.read();
}while(n=='\n'|n=='\r');
System.out.println("Le nombre total de triplets est "+n/3+".");
}
}
Secondly, I would appreciate a hint on how to write a program that displays the number of different DNA triplets from the entire sequence (which goes like this,par ex:LYS VAL PHE GLU ARG CYS GLU LEU VAL...etc.). It should display 7 for the given sequence. Should I start with/try arrays/variable cast/some kind of variable sorting?
Thanks in advance
sorry for this easy question(I couldn't solve the problem using Java beginner's guide). I want my program to divide whatever number I input by three. However it keeps returning false answers. Unfortunatelly, I can't figure why. Firstly, this is the code:
class AnalyseADN{
public static void main(String args[])
throws java.io.IOException{
int n;
do{
n=(int)System.in.read();
}while(n=='\n'|n=='\r');
System.out.println("Le nombre total de triplets est "+n/3+".");
}
}
Secondly, I would appreciate a hint on how to write a program that displays the number of different DNA triplets from the entire sequence (which goes like this,par ex:LYS VAL PHE GLU ARG CYS GLU LEU VAL...etc.). It should display 7 for the given sequence. Should I start with/try arrays/variable cast/some kind of variable sorting?
Thanks in advance