Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please DNA sequences are a series of four letters: A, C, G, and T. When our body is reading these sequences, it reads them

C++ please

DNA sequences are a series of four letters: A, C, G, and T. When our body is reading these sequences, it reads them in sets of three, which are referred to as codons. Each codon tells your body to do one of three things:

Start reading,

Add a molecule to the sequence,

Stop reading.

The START codon is ATG, and the STOP codons are either TAA, TAG, or TGA; any of those three will stop it. Every other combination of A/C/G/T will add a different molecule to the sequence.

function dnaRead which takes a vector of strings, each of length 3, as the parameter and returns the DNA sequence between the start and stop codons, with the following qualities:

Function Specifications:

The function name: dnaRead

The function parameters in this order:

vector dna: a vector of strings each of length 3, only containing A/C/G/T

The function returns a string:

If any vector element is not length 3 or contains a character that is none of A, C, G, or T, return "Invalid sequence." All letters should be capitals.

It returns the combined DNA sequence between the start and stop codons, EXCLUSIVELY.

If there is no start codon, it returns the empty string, "".

If there is no stop codon, it returns a string containing every codon in the vector that occurs after the start codon.

Sample run 1:

vector dna{"ATG", "TCA", "TAA"}; cout << dnaRead(dna) << endl;

Output:

TCA

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

explain the difference between logistics and physical distribution

Answered: 1 week ago