I've been working on this one for hours and I can't seem the get the correct commands into the program. PLZ HELP? THANKS IN ADVANCE!
Program Description: Messenger RNA (mRNA) molecules can be composed of different arrangements of 4 bases:
1. Adenine
2. Uracil
3. Cytosine
4. Guanine
Write a program that will generate and print out all the combinations of 3 bases which are possible within mRNA..
SAMPLE OUTPUT: (that I did myself, but can't get the program to)
AAA AAU AAC AAG
AUG AUU AUC AUG
ACA ACU ACC ACG
AGA AGU AGC AGG
UAA UAU UAC UAG
UUA UUU UUC UUG
UCA UCU UCC UCG
UGA UGU UGC UGG
CAA CAU CAC CAG
CUA CUU CUC CUG
CCA CCU CCC CCG
CGA C GU CGC CGG
CAA GAU GAC GAG
GUA GUU GUC GUG
GCA GCU GCC GCG
GGA GGU GGC GGG
Copyright © 2024 Q2A.ES - All rights reserved.
Answers & Comments
Verified answer
public class AUCG
{
public static void main ( String [ ] args )
{
String aucg = "AUCG" ;
for ( int i = 0 ; i < aucg . length ( ) ; ++i )
{ for ( int j = 0 ; j < aucg . length ( ) ; ++j )
{ for ( int k = 0 ; k < aucg . length ( ) ; ++k )
System.out.print ("" + aucg.charAt(i) + aucg.charAt(j) + aucg.charAt(k) + " ");
System.out.println();
}
}
}
}