Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#include #define MAX_IN_LENGTH 241 #define OUT_LENGTH 60 FILE *in; FILE *out; do

ID: 3529013 • Letter: #

Question

#include #define MAX_IN_LENGTH 241 #define OUT_LENGTH 60 FILE *in; FILE *out; double compare_DNA(char [], char [], char s[], int ); void print_DNA(char [], char [], char [], int ); int read_DNA(char []); int main() {chars1[MAX_IN_LENGTH],s2[MAX_IN_LENGTH],s3[MAX_IN_LENGTH],ans[MAX_IN_LENGTH]; double percent; int n,len; in= fopen("dna_input.dat","r"); if(in==NULL) //is it ok? { printf("input file did not open please checkit "); return 1; } out= fopen("dna_output.dat","w"); len=read_DNA(s1); len=read_DNA(s2); len=read_DNA(s3); fprintf(out,"Comparison between sequence # 1 and sequence #2: "); percent=compare_DNA(s1,s2,ans,len); print_DNA(s1,s2,ans,len); fprintf(out,"The overlap percentage is %.1f%% ",percent*100); fprintf(out,"Comparison between sequence # 1 and sequence #3: "); percent=compare_DNA(s1,s3,ans,len); print_DNA(s1,s3,ans,len); fprintf(out,"The overlap percentage is %.1f%% ",percent*100); fprintf(out,"Comparison between sequence # 2 and sequence #3: "); percent=compare_DNA(s2,s3,ans,len); print_DNA(s2,s3,ans,len); fprintf(out,"The overlap percentage is %.1f%% ",percent*100); fclose(in); fclose(out); return 0; } double compare_DNA(char seq1[], char seq2[], char seq3[], intn) {int i,count=0; for(i=0;i=n) stop=n-1; for(i=start;i

Explanation / Answer

I could not find your comment, where is the link??