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 For each employee, increment count if an employee meets both of the following conditions:
Grade is greater than
Age is greater than or equal to
Lastly, output count followed by a newline.
Ex: For the input:
then the output is:
import java.util.Scanner;
public class CombineArrays
public static void mainString args
Scanner scnr new ScannerSystemin;
final int NUMVALS ;
int employeeGrades new intNUMVALS;
int employeeAges new intNUMVALS;
int i;
int count;
for i ; i NUMVALS; i
employeeGradesi scnrnextInt;
for i ; i NUMVALS; i
employeeAgesi scnrnextInt;
Your code goes here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
