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]
3 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]3 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
In a database, a collection of related fields that describes some object or activity is referred to as a ____.
topjm [15]

In a database, a field is a collection of characters put together<span>; a collection of related fields that describes some object or activity is then referred to as a RECORD (which is sometimes called a row). The fields that make up a row are collectively relevant to a specific entity.</span>

7 0
3 years ago
The total revenues for a company are $150,223 and the total expenses were 125,766. If you are calculating the net income, which
krok68 [10]

Answer :

Net income =total revenue - total expenses

Net income =150223-125766

Net income =24457

In spreadsheet :

Total revenue = b2

Total expenses = b3

Net income will write in cell b4

So write formula in b4 to find net income :

=b2-b3

And press enter key to show your answer.

7 0
3 years ago
An automated service that consolidates and distributes information from newsgroups, blogs, forums and news websites is called
Butoxors [25]
It's called an <span>RSS (Really Simple Syndication).
</span>A Web service that aggregates selected information from various Web resources, including newsgroups, blogs, forums, and other news and information services and delivers it to a user ' s desktop in a convenient, easy-to-use format.
4 0
3 years ago
If the pc­doctor software is installed on a computer's hard drive, what two different ways can the program be started?
xeze [42]
<span> The PC-doctor software is system information tool used to diagnose and  test the computer and determine its configuration.</span>
If the PC-­doctor software is installed on a computer's hard drive, you should start the program in two different ways:<span>
1. Press function key during startup sequence
2. Start menu shortcut</span>


8 0
3 years ago
Sabian que hay una violadora sexuar el nombre de usario es SASHENKAFASION me acaba de decir que hackio en donde vivo,mi nombre c
grin007 [14]
Gracias por avisar eres muy amable
4 0
3 years ago
Other questions:
  • Computer communications describes a process in which two or more computers or devices transfer ____.
    10·1 answer
  • How do you change the slide layout?
    6·2 answers
  • What is the maximum number of fonts that should be used on a slide?
    13·1 answer
  • Which of the following is not a main function within end user support?
    13·1 answer
  • To expand the interface within CengageNOWv2, you need to click on the:_______.
    15·1 answer
  • A(n) ________ moves over the spinning platters to retrieve data from the hard disk.
    6·1 answer
  • Write the function powersOf3ToN(n) that takes a possibly-negative float or int n, and returns a list of the positive powers of 3
    10·1 answer
  • Did brainly.com go down today? i coudlnt get in it
    15·2 answers
  • What are the characteristics of the sorting and grouping options in Outlook? Check all that apply. Columns can be sorted by clic
    15·2 answers
  • Join each of the follwing sentences using unless
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!