Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use C++ language There is no gene for the human spirit. - Tagline for the 1997 film GATTACA The genetic code for all living organisms

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

use C++ language

There is no gene for the human spirit. - Tagline for the 1997 film GATTACA The genetic code for all living organisms is carried in its DNA-a molecule with the remarkable capacity to replicate its own structure. The DNA molecule itself consists of a long strand of chemical bases wound together with a similar strand in a double helix. DNA's ability to replicate comes from the fact that its four constituent bases-adenosine, cytosine, guanine, and thymine-combine with each other only in the following ways: Cytosine on one strand links only with guanine on the other, and vice versa Adenosine links only with thymine, and vice versa. Biologists abbreviate the names of the bases by writing only the initial letter: A, C, G, or T. Inside the cell, a DNA strand acts as a template to which other DNA strands can attach themselves. As an example, suppose that you have the following DNA strand, in which the position of each base has been numbered as it would be in a C++ string: T A A G G T A G T 0 1 2 3 4 5 6 7 8 9 10 11 Your mission in this exercise is to determine where a shorter DNA strand can attach itself to the longer one. If, for example, you were trying to find a match for the strand T T G the rules for DNA dictate that this strand can bind to the longer one only at position 1: T T A G C G T A T A G T 1 1 0 1 2 3 4 5 6 7 8 9 10 11 By contrast, the strand T G C matches at either position 2 or position 7. Write a function int findDNAMatch (string sl, string s2, int start = 0 ); that returns the first position at which the DNA strand sl can attach to the strand s2. As in the find method for the string class, the optional start parameter indicates the index position at which the search should start. If there is no match, findDNAMatch should return -1. Requirments & Hints: Please fill in the TODO part of Find DNAMatch.cpp. 1 /* C.../ 4 5 #include 6 #include 7 #include "P2FindDNAMatch.h" 8 using namespace std; 9 10 11 /* Function definition */ 121 13 int findDNAMatch(string si, string s2, int start) { 141 // TODO 15 161 } A non- 17 18 /* Function definition */ 19 201 string matchingStrand (string strand) { 22 // TODO 23 241 } A non- 21 4 25 26 /* Function definition */ 27 28 29 void findAllMatches (string sl, string s2) { 30 // TODO 31 32] } 33 34 35 /* Function definition * */ 36 37) int P2Find DNAMatch() { 39 findAllMatches ("TTGCC", "TAACGGTACGTC"); 40 findAllMatches ("TGC", "TAACGGTACGTC"); 41 findAllMatches ("CCC", "TAACGGTACGTC"); 42 return 0; 43} 38 A4

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

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

=+8. Why is productivity important?

Answered: 1 week ago

Question

=+ 9. What is inflation and what causes it?

Answered: 1 week ago

Question

=+6. What does the invisible hand of the marketplace do?

Answered: 1 week ago