Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

IN JAVA PLEASE! DO ALL Write a method which is passed an array of int[ ] A and a

ID: 3704017 • Letter: I

Question

IN JAVA PLEASE! DO ALL

Write a method which is passed an array of int[ ] A and an int t (for threshold). The method returns the number of odd items in A which are greater than or equal to t.
Write a method which is passed a two dimensional array of int A[][], and an int t. The method returns the index of the row in A which contains the greatest number of odd numbers greater than or equal to t. The method returns -1 if no row has any odd numbers greater than t. You may use your answer to part a in your answer to this part.

Write a method which is passed A[], which is an array of int, and an int passingScore. The method returns the number of items in A[] which are greater than or equal to passingScore.

Write a method which is passed an array of int A[]. The method returns true if A[] is the same backwards and forwards.

Write a method same( ), which is passed two arrays of int. The method returns true if the two arrays contain exactly the same contents.

Write a method called copy, which is passed A[], which is an array of int. The method returns a new array consisting of exactly the same items in A[].

Write a method called copy, which is passed A[], which is an array of int, and an integer n. The method returns a new array consisting of the first n items in A[].

Write a method called slice, which is passed A[], which is an array of int, an integer i and an integer j. The method returns a new array consisting of all of the items in A from A[i] to A[j] inclusive.

Write a method called copy, which is passed A[], which is an array of int, and an integer n. The method returns a new array consisting of all of the items in A[] which are greater or equal to n.

Write a method which is passed an array of int and returns true if the array is sorted in ascending order.

Write a method which is passed a String and returns the String in reverse.

Write a method which is passed an array of String and modifies it so that all the Strings in the array are reversed. For example, if we pass the array: {"apple", "banana", "racecar", "abc"} the method transforms it to: {"elppa", "ananab", "racecar", "cba"}

Write a method which is passed a two-dimensional array of int row by row. Do not assume that each row has the same number of columns.

Write a method which is passed a two-dimensional array of int column by column.

Implement the method:

Write a method which is passed a String which returns true if the String contains a double letter or false otherwise.

Write a method which is passed a String. It returns the index of the last Roman Numeral (recall that the Roman Numerals are {'I', 'V', 'X', 'L', 'C', 'D', 'M'}) found in the String or -1 if no Roman Numeral is found in the String.

Write a method which is passed a String s and returns a String that's exactly the same as s, but with no vowels.

Write a method which is passed a String s and returns a new String that's the same as s, but with the first letter of each word capitalized. There is a static method in the Character class toUpperCase that is passed a char c. If c is a lower-case letter, it returns its upper case equivalent. If it's not a lower-case letter, it returns c.

Write a method called acronym, which is passed a String s and returns a new String consisting of the first letter of each word in s. For example, if s refers to the String "United Parcel Service", the method returns the String "UPS"

Explanation / Answer

Hi friend, Question is too Big, Please repost others in separate post.

I have answered 10 methods.

Please let me know if there is any issue in answered part:

Write a method which is passed A[], which is an array of int, and an int passingScore. The method returns the number of items in A[] which are greater than or equal to passingScore.

static int itemGreaterThanPassingScore(int[] A,int passingScore)

{

int count=0;

for( int item: A)

{

if(item>=passingScore)

count++;

}

return count;

}

---------------------------------------------------------------------------------------------------------------------------------------------------

Write a method which is passed an array of int A[]. The method returns true if A[] is the same backwards and forwards.

static boolean pallindrome(int[] A)

{

int i=0,j=A.length - 1;

while(i<j)

{

if(A[i] != A[j])

return false;

}

return true;

}

------------------------------------------------------------------------------------------------------------------------------------------------------

Write a method same( ), which is passed two arrays of int. The method returns true if the two arrays contain exactly the same contents.

static boolean same(int[] A, int[] B)

{

        boolean equalOrNot = true;

        if(A.length == B.length)

        {

            for (int i = 0; i < A.length; i++)

            {

                if(A[i] != B[i])

                {

                    equalOrNot = false;

                }

            }

        }

        else

        {

            equalOrNot = false;

        }

         

        if (equalOrNot)

        {

return true;

        }

        else

        {

return false;

        }

}

------------------------------------------------------------------------------------------------------------------------------------------

Write a method called copy, which is passed A[], which is an array of int. The method returns a new array consisting of exactly the same items in A[].

static int[] copy(int[] A)

{

int[] B= new int[A.length];

for (int i=0; i<A.length; i++)

B[i] = A[i];

return B;

}

--------------------------------------------------------------------------------------------------------------------------------------------------

Write a method called copy, which is passed A[], which is an array of int, and an integer n. The method returns a new array consisting of the first n items in A[].

static int[] copy(int[] A,int n)

{

int[] B= new int[n];

for (int i=0; i<n; i++)

B[i] = A[i];

return B;

}

------------------------------------------------------------------------------------------------------------------------------------------

Write a method called slice, which is passed A[], which is an array of int, an integer i and an integer j. The method returns a new array consisting of all of the items in A from A[i] to A[j] inclusive.

static int[] copy(int[] A,int x,int y)

{

int[] B= new int[y-x+1];

for (int i=x; i<=y; i++)

B[i] = A[i];

return B;

}

------------------------------------------------------------------------------------------------------------------------------------------

Write a method called copy, which is passed A[], which is an array of int, and an integer n. The method returns a new array consisting of all of the items in A[] which are greater or equal to n.

static int[] copy(int[] A,int n)

{

int count=0;

for( int item: A)

{

if(item>=n)

count++;

}

int[] B= new int[count];

int j=0;

for (int i=0; i<A.length; i++)

{

if (A[i]>=n)

B[j++] = A[i];

}

return B;

}

--------------------------------------------------------------------------------------------------------------------------------------

Write a method which is passed an array of int and returns true if the array is sorted in ascending order.

static boolean checkSorted(int[] A)

{

boolean sorted = true;

for (int i = 0; i < A.length - 1; i++) {

if (A[i] > A[i+1]) {

sorted = false;

break;

return sorted;

}

-----------------------------------------------------------------------------------------------------------------------------------------------

Write a method which is passed a String and returns the String in reverse.

static String rev(String input)

{

StringBuilder rev=new StringBuilder(input);

rev.reverse();

return rev.toString();

}

---------------------------------------------------------------------------------------------------------------------------------------------

Write a method which is passed an array of String and modifies it so that all the Strings in the array are reversed. For example, if we pass the array: {"apple", "banana", "racecar", "abc"} the method transforms it to: {"elppa", "ananab", "racecar", "cba"}

static String[] revArray(String[] input)

{

int len=input.length;

String[] B=new String[len];

int j=0;

for(String str: input)

{

StringBuilder rev=new StringBuilder(str);

rev.reverse();

B[j++]=rev.toString();

}

return B;

}

Please DONT forgot to rate my answer. We are working hard for you Guys!!