Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

= Write a program that includes a static method named countCommon. It accepts three arrays of strings as parameters and returns an integer count of

image text in transcribed

= Write a program that includes a static method named countCommon. It accepts three arrays of strings as parameters and returns an integer count of how many indexes store exactly the same string in all three arrays. For example, if the arrays are: // index 0 1 2 3 4 5 6 7 String[] a1 = {"hi", "Ed", "how", "are", "you", "folks", "Doing", "today?"}; String[] a2 {"hi", "Bob", "how", "are", "YOUR", "kids", "doing", "today?"}; String[] a3 = {"hi", "you", "how", "are", "you", "guys", "DOING", "today?"}; Then the call of count Common (a1, a2, a3) should return 4 because indexes 0, 2, 3, and 7 store exactly the same string in all three arrays. Indexes 1, 4, 5, and 6 do not. (Index 6 differs by capitalization.) The arrays might not be the same length. An index must be within the bounds of all three arrays to be considered. For example, given the arrays below, the call of count Common (a4, a5, a6) should return 3 because all three arrays store the same values at indexes 0, 2, and 5: // index 0 1 2 3 4 5 6 7 String[] a4 = {"hi", "Ed", "how", "ARE", "you", "Doing", "I'm", "fine"}; String[] a5 {"hi", "Bob", "how", "are" "YOU" "Doing"); String[] a6 {"hi", "you", "how", "is", "you", "Doing", "this", "fine", "day?"}; For full credit, do not modify the elements of the arrays passed in. Do not make any assumptions about the length of the arrays or the length of the strings stored in them. You may assume that none of the arrays or elements are null. - =

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

Can anyone be trained to be a project manager?

Answered: 1 week ago

Question

=+j Improve the effectiveness of global and virtual teams.

Answered: 1 week ago