Question
Write a function that will help the doctors find the best matching amongst the three known genomes with a sequence from the unknown bacteria. The
Write a function that will help the doctors find the best matching amongst the three known genomes with a sequence from the unknown bacteria.
The function must be named analyzer
The function does not return any value.
The function will take in 4 string input parameters in the order
The first string parameter corresponds to genome 1
The second string parameter corresponds to genome 2
The third string parameter corresponds to genome 3
The fourth string parameter corresponds to sequence of the unknown bacteria
Display the best matching genome amongst the three genomes:
Eg : If genome 1 is the best match, the output would be
Genome 1 is the best match
If 2 or more genomes are the best matches, then display all the best matches in seperate lines:
E.g. If genome 2 and 3 are the best matches then display the following:
Genome 2 is the best match
Genome 3 is the best match
If either of the genomes or sequence is empty, display the following output and exit the function:
Genome and sequence cannot be empty
If the three genome length does not match, display the following output and exit the function:
Genome length does not match
If the sequence length is greater than any of the genome, display the following output and exit the function:
Sequence length must be smaller than genome length
Example1: One of the genomes has the best match
genome 1 | AATGTTTCACC |
genome 2 | GACCGACTAA |
genome 3 | AAGGTGCTCC |
sequence | TACTA |
Genome 2 is the best match. |
For example:
Test | Result |
---|---|
//For genome 2 is best match string g1 = "TAAGGCA"; string g2 = "TACCTAC"; string g3 = "AGCCAGA"; string seq = "TCT"; analyzer(g1,g2,g3,seq); | Genome 2 is the best match. |
//two of the genomes are best match string g1 = "CATCATAATTAGCACGTTGTTGGTACCTAGAGACCAACTTAC"; string g2 = "TGGAGACCCACCCGTTACTTCTGACAGACAGAAGTGAGCGAT"; string g3 = "CCTAACGTGTGGCCACGCGGGAGAAGAGGTTTACCATTCTGC"; string seq = "TCTTTTA"; analyzer(g1,g2,g3,seq); | Genome 2 is the best match. Genome 3 is the best match. |
C++ only
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started