Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ITS ON JAVA = Write a program that includes a static method named count Common. It accepts three arrays of strings as parameters and returns

image text in transcribedITS ON JAVA

= Write a program that includes a static method named count Common. 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 countCommon(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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

=+Identify the type of global assignment for which CCT is needed.

Answered: 1 week ago