DNA is now human uniqueness is implemented in biology. Each person has about 3 b
ID: 3834418 • Letter: D
Question
DNA is now human uniqueness is implemented in biology. Each person has about 3 billion nucleotides in their DNA. Nucleotides are included as ‘A’, ‘C’, ‘G’, or ‘T’. Assume that a child’s DNA comes from their parents by randomly choosing the DNA at the same position from either the child’s mother or father.
DNA
-child: char[]
-SIZE: long = 300000000000
Select the correct signature for the following methods/constructors in the DNA class. Include whether the method should be static or not.
a) A constructor that takes two parents DNA and builds a DNA object for a child.
b) An instance method that takes two parents DNA and creates a DNA object for the child.
c) A class method that takes two parents DNA and creates a DNA object for the child.
d) An instance method that counts how many nucleotides have a given label (‘A’,’C’, ‘G’, or ‘T’).
e) A class method that counts how many nucleotides have a given label (‘A’, ‘C’, ‘G’, or ‘T’).
DNA
-child: char[]
-SIZE: long = 300000000000
Explanation / Answer
The signatures for the given options are as follow:
a)
The constructor signature is as follows:
public DNA(DNA father_dna, DNA mother_dna)
{
}
b)
The instant method signature is as follows:
public DNA instant_dna(DNA father_dna, DNA mother_dna)
{
}
c)
The class method signature is as follows:
public static DNA method_dna(DNA father_dna, DNA mother_dna)
{
}
d)
The instant method signature is as follows:
public int count()
{
}
e)
The class method signature is as follows:
public static int count()
{
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.