Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Method mismatch: Write a static method named mismatch that accepts two Strings as parameters and returns the number of mismatches. Each String is assumed to
Method mismatch:
Write a static method named mismatch that accepts two Strings as parameters and returns
the number of mismatches. Each String is assumed to represent DNA sequence, that means
consists of capital A C G and T letters only. For a match we need A and T to be lined up and C
and to be lined up for every pair. For example, to get a mismatch A should line up with A C or
or will not have a pair at all. See examples below.
Examples:
mismatch ATCGAT "TAGCTA" returns
ATCGAT
TAGCTA
mismatch ATCGAT "TAGCAA" returns
ATCGAT
TAGCAA
mismatch ATCGAT "TATCTT" returns
ATCGAT
TATCTT
mismatch ATCG "TATCTT" returns
ATCG
TATCTT
Note : You can use the above examples in your main to check the methods works as intended.
Note : You can assume a legit input to the method, so no need to check for input correctness.
Tip : This method returns things, that means to check it you need to call it and store or print
result.
Tip : When working with Strings methods like chartAti and length can be useful.
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