Question: Integer arrays studentGrades and years Registered are read from input. For each element in yearsRegistered, if an element is greater than or equal to
Integer arrays studentGrades and years Registered are read from input. For each element in yearsRegistered, if an element is greater than or equal to 30, output studentGrades corresponding element followed by a space. After the final output, end with a newline Ex: For the input: 97 47 25 98 35 14 29 50 then the output is: 97 90 4 5 -67891911234567 6 19 21 10 18 20 public static void main(String[] args) { Scanner scnr = new Scanner (System.in); } final int NUM VALS = 4; int[] studentGrades new int[NUM_VALS]; int[] yearsRegistered new int [NUM_VALS]; int i; for (i = 0; i < NUM_VALS; ++i) { student Grades [i] = scnr.nextint(); } for (10; 1 < NUM_VALS; ++i) { yearsRegistered [1] scnr.nextInt(); /* Your code goes here */ P
Step by Step Solution
3.41 Rating (145 Votes )
There are 3 Steps involved in it
import javautilScanner public class Main public static void mai... View full answer
Get step-by-step solutions from verified subject matter experts
