Question: Program Input : your program should prompt the user to enter two strings from keyboard, representing two DNA sequences on alphabete of {A, C, G,

Program Input: your program should prompt the user to enter two strings from keyboard, representing two DNA sequences on alphabete of {A, C, G, T}.

Error checking: before executing the algorithm, your program should check both strings to ensure only acceptable DNA letters (A, C, G, T) are entered. Do not run the algorithm if they contain any errors inside. In the event of an error, indicate how many characters are illegal, and show the original string with the illegal letters highlighted, for example show an error message of the following type:

Input contains error Error in String #1: aacgttcOgMa Error in String #2: ggataccaSat

Write this function in LCS.cpp which will validate the two input string X and Y respectively.It return true if both are valid DNA sequence; otherwise it returns false and print the relevant error information on screen.

LCS.cpp

#include "LCS.h" #include

using namespace std;

bool validate(string strX, string strY) {

}

LCS.h

#pragma once

#ifndef LCS_H

#define LCS_H

#include

using namespace std;

bool validate(string strX, string strY);

#endif

Assignment6.cpp (some more functions are included here which you can feel free to delete)

#include "LCS.h"

#include

#include

using namespace std;

//This function used to print the table contents

void printLengthTable(int** C, int m, int n);

void printArrowTable(char** B, int m, int n);

int main()

{

string strX, strY;

cout

cin >> strX;

cout

cin >> strY;

//validate the input two strings

if (validate(strX, strY) == false)

{

return 0;

}

int m = strX.length();

int n = strY.length();

//declare two dynamic 2-Dimensional array of variable length

//C is (m+1)X(n+1) and B is m X n

int** C;

char** B;

initLCSTable(&C, &B, m, n);

fillLCSTable(strX, strY, C, B);

cout

cout

cout

printLengthTable(C, m, n);

cout

printArrowTable(B, m, n);

freeLCSTable(C, B, m);

return 0;

}

Test example:

Input:

Program Input: your program should prompt the user to enter two strings

Output:

from keyboard, representing two DNA sequences on alphabete of {A, C, G,

AACGTTCOGMA GGATACCASAT AACGTTCOGMA GGATACCASAT

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!