Task 2: RNA class

The RNA molecule is closely related to the DNA molecule. The major difference is that RNA contains Uracil (U) rather than Thymine (T). Given a DNA strand, we can arrive at the corresponding RNA strand by replacing all occurrences of T by U.

The protein string encoded by a given RNA is computed by grouping three adjacent nucleotides (such grouping is referred to as {\em codon}) and converting them into one of the twenty amino acids. There are sixty four possible codons, so each amino acid can be encoded by multiple codons.

The mapping from the three letter RNA codons to the proteins is show in the table below, but you may prefer to use the following two arrays. (HINT: the code is much shorter if you use the arrays.) In the array the i'th row of the codons array lists all the codons that encode the i'th protein in the proteins array.

String [][] codons = {{ "AUU", "AUC", "AUA"  }, { "CUU", "CUC", "CUA", 
			   "CUG", "UUA", "UUG"  },  { "GUU", "GUC", "GUA", "GUG"  }, 
			   { "UUU", "UUC"  }, { "AUG"  }, { "UGU", "UGC"  },  
			   { "GCU", "GCC", "GCA", "GCG"  }, { "GGU", "GGC", "GGA", "GGG"  }, 
			   { "CCU", "CCC", "CCA", "CCG"  },  { "ACU", "ACC", "ACA", "ACG"  }, 
			   { "UCU", "UCC", "UCA", "UCG", "AGU", "AGC"  }, { "UAU", "UAC"  }, 
			   { "UGG"  }, { "CAA", "CAG"  }, { "AAU", "AAC"  }, { "CAU", "CAC"  }, 
			   { "GAA", "GAG"  },  { "GAU", "GAC"  }, { "AAA", "AAG"  }, 
			   { "CGU", "CGC", "CGA", "CGG", "AGA", "AGG"  },  { "UAA", "UAG", "UGA"  }};
String [] proteins = { "I", "L", "V", "F", "M", "C", 
			   "A", "G", "P", "T", "S", "Y", "W", "Q", "N", 
			   "H", "E", "D", "K", "R", "stop"}  ;		
		
		

You need to implement the `RNA` class that provides the following capabilities:

In addition you need to create a TestRNA class that contains a program (read `main()` method) that

This program should be interactive, i.e., the user should be prompted for the DNA sequence and the program should print out corresponding RNA sequence and the protein sequence. You should include other tests to make sure that all your methods in the RNA class are working as specified (use TestDNA class from Task 1 as a guide).