Question: Java for DNA sequences 1)design a DNA sequence class called DNA with a validation method called IsDNAvalid() to validate if the DNA sequence contains any
Java for DNA sequences
1)design a DNA sequence class called DNA with a validation method called IsDNAvalid() to validate if the DNA sequence contains any invalid letter (not A, C, G, T). You can use the charAt() method of the String class to loop through a sequence string to check if each letter is valid. Design another class which contains the main() method, and create a DNA object inside the main method, then call the IsDNAvalid() method to validate the DNA sequence input. 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.
(question #1 and 2 can be combined into a single DNA class to contain all the required methods) (with comments)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
