Question: S My library > IFT 2 1 0 : Introduction to Java Technologies home > 6 . 1 0 : Array parameters zyBooks catalog CHALLENGE

S My library > IFT 210: Introduction to Java Technologies home >6.10: Array parameters
zyBooks catalog
CHALLENGE
ACTIVITY
6.10.2: Array parameters.
528040.3489528.9x3zqy7
Jump to level 1
Five integers are read from input and stored into the array myArray. Write a static method addNumToElements() that takes an integer array parameter and adds 3 to each element in the array.
Ex: If the input is 65.55,90,60,50, then the output is:
Input array: 65,55,90,60,50
Output array: 68,58,93,63,53
import java.util.Scanner;
public class ArrayMethods {
Y* Your code goes here */
public static void printArr(int[] arr){
int i;
for arr. length; ++i){
System.out.print(arr[i]+"");
}
System.out.println();
}
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
1
3
 S My library > IFT 210: Introduction to Java Technologies home

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!