Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For any element in keysList with a value greater than 50, print the corresponding value in itemsList, followed by a space. Ex: If the input

image text in transcribed

For any element in keysList with a value greater than 50, print the corresponding value in itemsList, followed by a space. Ex: If the input is: 32 105 101 35 10 20 30 40 the output is: 20 30 6 9 1 import java.util.Scanner; 2 3 public class Compare { 4 5 public static void main(String args[]) { final int SIZE_LIST = 4; 7 int[] keysList = new int[SIZE_LIST]; 8 int[] itemsList = new int[SIZE_LIST]; int i; 10 Scanner input = new Scanner(System.in); 11 12 keysList[0] = input.nextInt(); 13 keysList[1] = input.nextInt(); 14 keysList[2] = input.nextInt(); 15 keysList[3] = input.nextInt(); 16 17 itemsList[0] = input.nextInt(); 18 itemsList[1] = input.nextInt(); 19 itemsList[2] = input.nextInt(); 20 itemsList[3] = input.nextInt(); 21 22 System.out.println(); 23 } 24 25}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

KEY QUESTION Refer to Figure 3.6, page

Answered: 1 week ago