The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
1. In object-oriented programming design, such as in Java, your program often consists of two or more classes (often written in different .java source files). One class contains the main() method to generate the console output, while the other classes may just contain properties or methods to process the data. Using this approach to re-design question #3 of Homework01 by putting the DNA sequence validation part into a method called IsDNAvalid() in a separate class, called DNA, or something else (your project should contain 2 .java source files). In the class that contains the main() method, create a DNA object, and then call the IsDNAvalid() method to validate the DNA sequence input. (2 points)
2. Add two more methods to the DNA class in question #1, getSize() to return the length of the DNA sequence, and baseCount() to count the number of a particular base nucleotide. The baseCount() method will take in one parameter, a base nucleotide (A, T, G, or C), and return a number count of that nucleotide in the DNA sequence, such as:
count_of_A = dna.baseCount('A');
count_of_C = dna.baseCount('C');
Using these two new methods in your program to calculate the percentage of GC contents in the DNA sequence you entered. Round your answer to 2 decimal places. (4 points)
3. We all know that the DNA molecules are double-stranded in living cells. Please design a Java program to prompt the user to enter a DNA sequence and then find the complement sequence of that DNA sequence, and print out a double-stranded DNA with the complement strand right beneath the original DNA sequence. See the sample output below. (2 points)
Sample output:
Here is the starting DNA:
ACGGGAGGACGGGAAAATTACTACGGCATTAGC
Â
Here is the double-stranded DNA:
ACGGGAGGACGGGAAAATTACTACGGCATTAGC
TGCCCTCCTGCCCTTTTAATGATGCCGTAATCG
-----------