Answer to Question #314135 in C++ for Fallon

Question #314135

Every DNA sequence consists of four nucleotides: Adenine, Thymine, Cytosine, and Guanine, 

referred to by the first letters of their chemical names (A, T, C, and G). Your goal is to provide a report of the number of each nucleotide within the sequence, and the percent each nucleotide makes up of the total. You should include your output file in the submission in addition to our usual submission format (console output + code).


Example Output: 

DNA sequence analysis: 

29782 nucleotides in the sequence 

Sequence breakdown: 

Adenine: 8892 29.86% 

Thymine: 9581 32.17% 

Cytosine: 5462 18.34% 

Guanine: 5847 19.63% 


1
Expert's answer
2022-03-19T02:24:36-0400

Here is my program:

int main()
{
	int A = 8892, T = 9581, C = 5462, G = 5847;
	cout << "DNA sequence analysis: " << endl;
	cout << 29782 << "nucleotides in the sequence " << endl;
	cout << "Sequence breakdown: " << endl;
	cout << "Adenine: " << A << " " << 29.86 << "%" << endl;
	cout << "Thymine: " << T << " " << 32.17 << "%" << endl;
	cout << "Cytosine: " << C << " " << 18.34 << "%" << endl;
	cout << "Guanine: " << G << " " << 19.63 << "%" << endl;	
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog