64 763
Assignments Done
99,3%
Successfully Done
In September 2018

Answer to Question #59018 in Java | JSP | JSF for Sherlynn

Question #59018
write a method to receive 3 parameters:
- an array of integer numbers
- an integer value : low
- an integer value : high
the method will create new array and copy all the value that are between low and high into new array. the method will return the new array upon completion
Expert's answer
package com.company;

import java.util.Arrays;

public class Main {

public static int [] copyArrayFromLowtoHigh(int [] arr, int low, int high){
int N = (high - low) + 1;
int [] result = new int[N];
for (int i = 0; i < N; i++){
result[i] = arr[low++];
}
return result;
}

public static void main(String[] args) {
int [] arr = {1, 3, 4, 56, 22, 11, 12, 45, 78, 32, 11};
System.out.println(Arrays.toString(copyArrayFromLowtoHigh(arr, 1, 4)));

// write your code here
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
13.04.16, 16:39

It is just a placeholder for further modifications. The program is complete.

Sherlynn
13.04.16, 03:33

Can write the full code pls? // write code here thanks

Assignment Expert
12.04.16, 17:26

Dear Sherlynn,

Questions in this section are answered for free. We can't fulfill them all and there is no guarantee of answering certain question but we are doing our best. And if answer is published it means it was attentively checked by experts. You can try it yourself by publishing your question. Although if you have serious assignment that requires large amount of work and hence cannot be done for free you can submit it as assignment and our experts will surely assist you.

Sherlynn
12.04.16, 04:59

this question has not been answer yet

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions