Aga Cga

June 27th, 2007

Java Program Help (loops)?

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)

AAAAAUAACAAG
AUGAUUAUCAUG
ACAACUACCACG
AGAAGUAGCAGG
UAAUAUUACUAG
UUAUUUUUCUUG
UCAUCUUCCUCG
UGAUGUUGCUGG
CAACAUCACCAG
CUACUUCUCCUG
CCACCUCCCCCG
CGAC GUCGCCGG
CAAGAUGACGAG
GUAGUUGUCGUG
GCAGCUGCCGCG
GGAGGUGGCGGG

I would use nested loops, such as like this:

String letters[4] = {“A”,”U”,”C”,”G”};

for ( String a : letters )
for ( String b : letters )
for ( String c : letters )
System.out.println(a+b+c);

(Note: that may not work, as I haven’t tested it, and I’ve been working with some other languages recently)

eBay Logo  

1/2


1/2″ IPS BRASS GAS BALL VALVE, T HANDLE AGA/CGA/UL


$2.99


3/4


3/4″ IPS BRASS GAS BALL VALVE, T HANDLE AGA/CGA/UL


$6.95


1/2


1/2″ Gas Ball Valve AGA CGA Red White Valves 250 psi Q11F-600TB2 5200T NEW


$9.95


AGA 355-2 CGA E-4 Pressure Gauge


AGA 355-2 CGA E-4 Pressure Gauge


$49.99


AGA CB 200/1 3B-510 regulator 3000 psi chrome valve used welding CGA 510


AGA CB 200/1 3B-510 regulator 3000 psi chrome valve used welding CGA 510


$145.00

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
Comments are closed.