Answered step by step
Verified Expert Solution
Link Copied!

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 G to be lined up for every pair. For example, to get a mismatch A should line up with A, C or
G, or will not have a pair at all. See examples below.
Examples:
mismatch ("ATCGAT", "TAGCTA") returns 0
ATCGAT
|||||
TAGCTA
mismatch ("ATCGAT", "TAGCAA") returns 1
ATCGAT
||||x|
TAGCAA
mismatch ("ATCGAT", "TATCTT") returns 2
ATCGAT
||x||x
TATCTT
mismatch ("ATCG", "TATCTT") returns 3
ATCG
||x|
TATCTT
Note 1: You can use the above examples in your main to check the methods works as intended.
Note 2: You can assume a legit input to the method, so no need to check for input correctness.
Tip 1: This method returns things, that means to check it you need to call it and store or print
result.
Tip 2: When working with Strings methods like chartAt(i) and length() can be useful.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

What impediments deal with customers?

Answered: 1 week ago