Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A- find the answers for this 1-Write a method which is passed A[], which is an array of int, and an int passingScore. The method

A- find the answers for this

1-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.

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

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

4-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[].

5-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[].

6-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.

7-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.

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

9-Write a method called generateTriangleNumbers(). This method will take in an integer x and will return an array of integers containing the first x triangle numbers. The nth triangle number is the sum of 1 + 2 + 3 + 4...(n 1) + n.

generateTriangleNumbers(3) returns the array {1,3,6}

generateTriangleNumber(1) returns the array {1}

generateTriangleNumbers(7) returns the array {1, 3, 6, 10, 15, 21, 28}

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

11-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"}

12-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.

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

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

EXPLAIN the strategic importance of total rewards.

Answered: 1 week ago

Question

=+j Explain the essential nature of repatriation.

Answered: 1 week ago