Question: Integer numElements is read from input and integer array customerNums is declared with size numElements. Read numElements integers from input and store each integer into

Integer numElements is read from input and integer array customerNums is declared with size numElements. Read numElements integers from input and store each integer into customerNums in the order the integers are read.
Ex: If the input is
6
643056552387
then the output is:
Array contents: 643056552387
import java.util.Scanner;
public class CustomerData {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
int numElements;
int i;
numElements = scnr.nextInt();
int[] customerNums = new int[numElements];
/* Your code goes here */
System.out.print("Array contents: ");
for (i =0; i < customerNums.length; ++i){
System.out.print(customerNums[i]+"");
}
System.out.println();
}
}

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!