Question: Integer arrays employeeGrades and employeeAges are read from input, containing the grades and ages of each employee. Initialize variable count with 0 . For each

Integer arrays employeeGrades and employeeAges are read from input, containing the grades and ages of each employee. Initialize variable count with 0. For each employee, increment count if an employee meets both of the following conditions:
Grade is greater than 55.
Age is greater than or equal to 30.
Lastly, output count followed by a newline.
Ex: For the input:
775046998024
411816314725
then the output is:
3
import java.util.Scanner;
public class CombineArrays {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
final int NUM_VALS =6;
int[] employeeGrades = new int[NUM_VALS];
int[] employeeAges = new int[NUM_VALS];
int i;
int count;
for (i =0; i < NUM_VALS; ++i){
employeeGrades[i]= scnr.nextInt();
}
for (i =0; i < NUM_VALS; ++i){
employeeAges[i]= scnr.nextInt();
}
/* Your code goes here */
}
}

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!