Question: ACTIVITY 5 . 4 . 2 : Iterating through arrays. 5 2 8 0 4 0 . 3 4 8 9 5 2 8 .

ACTIVITY
5.4.2: Iterating through arrays.
528040.3489528.93zqy7
Given the integer array yearlySalaries with the size of ARR_LENGTH, write a for loop to output the integers in the second half of yearlySalaries. Separate the integers with an asterisk surrounded by spaces ("*"):
Ex: If the input is 33,87,114,38,73,42,37,52,83,74, then the output is:
42**37**52**83**74
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
final int ARR_LENGTH =10;
int [] yearlySalaries = new int [ARR_LENGTH];
int i;
for yearlySalaries.length; ++i){
}
yearlySalaries [i]= scnr. nextInt () ;
for your code goes here {
I* Your code goes here *I
}
System.out.println();
}
}
1
2
3
 ACTIVITY 5.4.2: Iterating through arrays. 528040.3489528.93zqy7 Given the integer array yearlySalaries

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!