1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
DedPeter [7]
4 years ago
8

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

f keysList = {32, 105, 101, 35} and itemsList = {10, 20, 30, 40}, print: 20 30
JAVA

import java.util.Scanner;

public class ArraysKeyValue {
public static void main (String [] args) {

final int SIZE_LIST = 4;
int[] keysList = new int[SIZE_LIST];
int[] itemsList = new int[SIZE_LIST];
int i;

keysList[0] = 13;
keysList[1] = 47;
keysList[2] = 71;
keysList[3] = 59;

itemsList[0] = 12;
itemsList[1] = 36;
itemsList[2] = 72;
itemsList[3] = 54;
Computers and Technology
1 answer:
VARVARA [1.3K]4 years ago
5 0

Answer:

import java.util.Scanner;  //mentioned in the question.

public class ArraysKeyValue {  //mentioned in the question.

public static void main (String [] args) {  //mentioned in the question.

final int SIZE_LIST = 4; //mentioned in the question.

int[] keysList = new int[SIZE_LIST]; //mentioned in the question.

int[] itemsList = new int[SIZE_LIST]; //mentioned in the question.

int i; //mentioned in the question.

keysList[0] = 13; //mentioned in the question.                                

keysList[1] = 47; //mentioned in the question.

keysList[2] = 71; //mentioned in the question.

keysList[3] = 59; //mentioned in the question.

itemsList[0] = 12; //mentioned in the question.

itemsList[1] = 36; //mentioned in the question.

itemsList[2] = 72; //mentioned in the question.

itemsList[3] = 54;//mentioned in the question.

// other line to complete the solution is as follows--

for(i=0;i<(keysList.length);i++) //Loop to access all the element of keysList array variable.

    {// open for loop braces

        if(keysList[i]>50) // compare the value of keysList array variable with 50.

        System.out.println(itemsList[i]); // print the value

   }// close for loop braces.

}//  close main function braces.

} //close the class braces.

Output:

72

54

Explanation:

In the solution part--

  1. One loop is placed which moves from 0 to (size-1) of the 'keyslist' array.
  2. Then the 'if' statement is used to check the element of 'keyslist' array, which is greater than 50 or not.
  3. If it is greater, then print the element of item_list array of 'i' index which is also the index of greater value of keyslist array element.

You might be interested in
suppose a network could gaurantee that all delivered packets were delivered in order. if a reliable transport protocol designer
marissa [1.9K]

When there is a reliable transport protocol designer They can make use of the TCP because it is one that guaranteed delivery.

<h3>What is the TCP?</h3>

TCP is known to be one that has been  set up as a kind of built-in systems. Its role is to look for errors and to help to guarantee data  delivery in the order it was sent.

It is one that makes a  perfect protocol for transferring information such as still images, data files, and others.

Learn more about  transport protocol from

brainly.com/question/26284086

8 0
2 years ago
Example of a question that could NOT be answered with a binary message
Temka [501]
So what is is being implied here is an question that doesn't have a yes or no answer. Philosophical questions would fit the bill here such as ; "If a tree falls in the forest, and no one is around to hear it, did it make a sound?" You, a computer or I cannot reasonably respond to that questions with a a yes or a no. 

Remember, Binary messages are a series of 1's or 0's. Implying on (1) or off (0).
7 0
3 years ago
Read 2 more answers
Which of the following in not part of the CIA triad that is one of the cornerstones of information security? a. Confidentiality
Nana76 [90]

Answer:I would need more information to help you ut, sorry

Explanation:

6 0
3 years ago
Before entering a road from an alley or driveway, you must:Flash your high beam headlights 
JulsSmile [24]

Stop before reaching the sidewalk. Hope this helps

3 0
3 years ago
What is a tag in an HTML document?
Rashid [163]
Code that specifies how the web page should be formatted
8 0
3 years ago
Other questions:
  • PLEASE HELP TAKING A TEST!!!
    10·2 answers
  • What is DBMS software used for?
    5·1 answer
  • A window frame will expand to fill the entire desktop when you
    15·1 answer
  • Write a program that calculates taxi fare at a rate of $1.50 per mile. Your pro-gram should interact with the user in this manne
    12·1 answer
  • Your company has purchased another company that also uses Windows Server 2016 and Active Directory. Both companies need to be ab
    11·1 answer
  • What do you expect the future trends of an operating system in terms of (a) cost (b) size (c) multitasking (d) portability (e) s
    12·1 answer
  • 1
    7·1 answer
  • What should you consider when using a wireless keyboard with your home computer
    15·1 answer
  • Which method can be used for making a robot perform a different set of functions?
    13·1 answer
  • What causes the hidden node problem in a wireless local area network (wlan)?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!