ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 10 Weeks Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 12 May 2017 My Price 9.00

create the Calculatebestmnatch function

Below is the code ive got so far. I cant figure out how to implemen pointers in the code and cant figure out how to create the Calculatebestmnatch function as denoted in the attachment. Need help making that function, and implementing pointers. please make sure to comment.

#include <iostream>
#include <functional>
#include <numeric>
#include <string.h>
using namespace std;
// function declaration
void comparestringSimilarity(string s1, string s2, int status);
int main()
{
cout << "Enter string 1n";
string s1;
getline(cin, s1);
cout << "Enter string 2 (of the same length)n";
string s2;
getline(cin, s2);
if(s1.size() == s2.size()){
cout << "The Hamming distance is ";
int diffs =inner_product(s1.begin(), s1.end(), s2.begin(), 0,plus<int>(), not_equal_to<char>());
cout<< diffs<<'n';}
else
cout << "The length of the strings entered is not equaln";

//using comparestringSimilarity(string s1, string s2, int status) function
int status;
comparestringSimilarity(s1,s2,status);
if(status==1)
   cout<<" Two strings are equal."<<endl;
else
   cout<<"Two strings are not equal."<<endl;
return 0;
}
// function defination
void comparestringSimilarity(string s1, string s2, int status){
if(s1.size() != s2.size()){ // strings are not similar
status = 0; // storing false value
return;
}
unsigned int i=0, j=0;
while(i<s1.size()){
if(s1.at(i) != s2.at(j)){ // current character is not equal
status = 0;
return;
}
i++;
j++;
}
// we reach here, means both strings are equal
status = 1;
}


void 

 

CSCI 1300/1310 - Assignment4Due Friday, Sept 23, by 12:30 pmCSCI 1300/1310 Introduction to Computer ProgrammingInstructors: Knox/HoenigmanAssignment4Due Friday, Sept 23, by 12:30 pmFor this assignment, the solution for all problems should be in a file calledAssignment4_LastName.cpp, where LastName is your last name. Please includecomments in your code that explain what your code is doing. The comments shouldalso include your name, recitation TA, and the assignment number.Measuring DNA SimilarityDNA is the hereditary material in human and other species. Almost every cell in aperson’s body has the same DNA. All information in a DNA is stored as a code in fourchemical bases: adenine (A), guanine (G), cytosine (C) and thymine(T). Differentorder of these bases means different information.One of the challenges in computational biology is determining what the codons in aDNA sequence represent. A codon is a sequence of three nucleotides that form a unitof genetic code in a DNA or RNA molecule.For example, given the sequence GGGA,the codon could be a GGG or a GGA, depending on where the gene begins and theactive bases in the gene. Clues about how to interpret a DNA sequence can be foundby comparing an unknown DNA sequence to a known sequence and measuring theirsimilarity. If sequences are similar, then it can be hypothesized that they havesimilar functions and proteins.Assignment Details:In this assignment, you will develop a few functions for DNA analysis. Thesefunctions will calculate common measures of DNA similarity, such as the Hammingdistance and the Best Match Hamming distance between two DNA sequences. Eachof the DNA sequences you need for this assignment can be copied from this write-upand stored in a variable in your program. There is a sample DNA sequence for amouse, human, and an unknown species. Your mission is to determine the identityof the unknown by comparing it to the human and the mouse. If the unknownspecies is more similar to the human than it is to the mouse, then you can concludethat the unknown sequence is from a human. Otherwise, you can conclude that theunknown is from a mouse.Your assignment needs to include at least the following functions for full credit:void calculateSimilarity(int *similarity, string DNA1, string DNA2);void calculateBestMatch(int *distance, int *index, string DNA1, stringDNA2);

Attachments:

Answers

(11)
Status NEW Posted 12 May 2017 07:05 AM My Price 9.00

-----------

Not Rated(0)