X447: Arrays - Double Array

Write a function in Java that takes the int array arr and returns a new array with each number being doubled. Be sure to make use of loops.

Examples:

doubleArray({1,2,3}) -> {2,4,6}
doubleArray({5,7,10}) -> {10,14,20}
doubleArray({6,0,8}) -> {12,0,16}

Your Answer:

Feedback

Your feedback will appear here when you check your answer.