I am building a applet that can read inputs from the user to make codons for DNA, so my teacher can use it. It reads the first three characters to make a codon, uses those characters to get a value (1, 2, 3 or 4), takes those character values to make a codon value (1 - 64), and then changes that codon value into the Amino Acid name. I am trying to take this int value, called codonNumber, and make it equal a different number, called from a void called getCodon. Can anyone help me? This is my error:
And this is the section of code I have the error in:Code:/tmp/jc_20900/DNA.java:144: getCodon(int) in DNA cannot be applied to ()
codonNumber = getCodon();
^
1 error
For your information, the brackets are correct, its just that the second closing bracket is the last ending bracket for my Main method. =pCode:if(firstInput != 0 && secondInput != 0 && thirdInput != 0)
{
codonNumber = getCodon();
}
}
public static void getCodon(int codonNumber){
if(firstInput == 1)
{
if(secondInput == 1)
{
if(thirdInput == 1)
{
codonNumber = 1;
} else
if(thirdInput == 2)
{
codonNumber = 2;
} else
if(thirdInput == 3)
{
codonNumber = 3;
} else
if(thirdInput == 4)
{
codonNumber = 4;
}
} else
if(secondInput == 2)
{
if(thirdInput == 1)
{
codonNumber = 5;
} else
if(thirdInput == 2)
{
codonNumber = 6;
} else
if(thirdInput == 3)
{
codonNumber = 7;
} else
if(thirdInput == 4)
{
codonNumber = 8;
}
} else
if(secondInput == 3)
{
if(thirdInput == 1)
{
codonNumber = 9;
} else
if(thirdInput == 2)
{
codonNumber = 10;
} else
if(thirdInput == 3)
{
codonNumber = 11;
} else
if(thirdInput == 4)
{
codonNumber = 12;
}
} else
if(secondInput == 4)
{
if(thirdInput == 1)
{
codonNumber = 13;
} else
if(thirdInput == 2)
{
codonNumber = 14;
} else
if(thirdInput == 3)
{
codonNumber = 15;
} else
if(thirdInput == 4)
{
codonNumber = 16;
}
}
} else
if(firstInput == 2)
{
if(secondInput == 1)
{
if(thirdInput == 1)
{
codonNumber = 17;
} else
if(thirdInput == 2)
{
codonNumber = 18;
} else
if(thirdInput == 3)
{
codonNumber = 19;
} else
if(thirdInput == 4)
{
codonNumber = 20;
}
} else
if(secondInput == 2)
{
if(thirdInput == 1)
{
codonNumber = 21;
} else
if(thirdInput == 2)
{
codonNumber = 22;
} else
if(thirdInput == 3)
{
codonNumber = 23;
} else
if(thirdInput == 4)
{
codonNumber = 24;
}
} else
if(secondInput == 3)
{
if(thirdInput == 1)
{
codonNumber = 25;
} else
if(thirdInput == 2)
{
codonNumber = 26;
} else
if(thirdInput == 3)
{
codonNumber = 27;
} else
if(thirdInput == 4)
{
codonNumber = 28;
}
} else
if(secondInput == 4)
{
if(thirdInput == 1)
{
codonNumber = 29;
} else
if(thirdInput == 2)
{
codonNumber = 30;
} else
if(thirdInput == 3)
{
codonNumber = 31;
} else
if(thirdInput == 4)
{
codonNumber = 32;
}
}
} else
if(firstInput == 3)
{
if(secondInput == 1)
{
if(thirdInput == 1)
{
codonNumber = 33;
} else
if(thirdInput == 2)
{
codonNumber = 34;
} else
if(thirdInput == 3)
{
codonNumber = 35;
} else
if(thirdInput == 4)
{
codonNumber = 36;
}
} else
if(secondInput == 2)
{
if(thirdInput == 1)
{
codonNumber = 37;
} else
if(thirdInput == 2)
{
codonNumber = 38;
} else
if(thirdInput == 3)
{
codonNumber = 39;
} else
if(thirdInput == 4)
{
codonNumber = 40;
}
} else
if(secondInput == 3)
{
if(thirdInput == 1)
{
codonNumber = 41;
} else
if(thirdInput == 2)
{
codonNumber = 42;
} else
if(thirdInput == 3)
{
codonNumber = 43;
} else
if(thirdInput == 4)
{
codonNumber = 44;
}
} else
if(secondInput == 4)
{
if(thirdInput == 1)
{
codonNumber = 45;
} else
if(thirdInput == 2)
{
codonNumber = 46;
} else
if(thirdInput == 3)
{
codonNumber = 47;
} else
if(thirdInput == 4)
{
codonNumber = 48;
}
}
} else
if(firstInput == 4)
{
if(secondInput == 1)
{
if(thirdInput == 1)
{
codonNumber = 49;
} else
if(thirdInput == 2)
{
codonNumber = 50;
} else
if(thirdInput == 3)
{
codonNumber = 51;
} else
if(thirdInput == 4)
{
codonNumber = 52;
}
} else
if(secondInput == 2)
{
if(thirdInput == 1)
{
codonNumber = 53;
} else
if(thirdInput == 2)
{
codonNumber = 54;
} else
if(thirdInput == 3)
{
codonNumber = 55;
} else
if(thirdInput == 4)
{
codonNumber = 56;
}
} else
if(secondInput == 3)
{
if(thirdInput == 1)
{
codonNumber = 57;
} else
if(thirdInput == 2)
{
codonNumber = 58;
} else
if(thirdInput == 3)
{
codonNumber = 59;
} else
if(thirdInput == 4)
{
codonNumber = 60;
}
} else
if(secondInput == 4)
{
if(thirdInput == 1)
{
codonNumber = 61;
} else
if(thirdInput == 2)
{
codonNumber = 62;
} else
if(thirdInput == 3)
{
codonNumber = 63;
} else
if(thirdInput == 4)
{
codonNumber = 64;
}
}
}
}

