Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
import javautilScanner public class Main public static void mai...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started