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
Why Is Jarvis Banned For Life? Literally Don't need to be forever!
Ahat [919]

Answer:

he used aimbot in playground (I think) and made videos of it for entertainment and Epic Games just banned him. I agree.. Epic could have banned him for weeks maybe not not for life.

Explanation:

5 0
3 years ago
Your older brother Max tells you about his secret plan to hack into his college’s computer network and change all of his grades.
viktelen [127]

Answer:

Tell him he could get kicked out of school and it can possibly show up on his record and lessen his chances of finding a job since no one will trust him. He should just focus and get his grades up instead of risking everything and "taking the easy way out".

Explanation:

6 0
2 years ago
What is the difference between a programming language and natural (every-day) language?
marta [7]

Answer:

Explanation:

Natural languages are used for communication between people and programming languages enable human to interact with machines.

8 0
3 years ago
Frank is preparing a subsection of the SRS document that specifies data formats, data integrity, and storage capabilities. Which
Flauer [41]

The subsection which Frank is preparing for the SRS document that specifies data formats, data integrity, and storage capabilities is Logical Database Requirements.

<h3>What is SRS document?</h3>

SRS document of the software requirement specification document is the document which describes the function of a software and its procedure to perform a particular function.

Different types of requirement-

  • A. External Interface Requirements- This includes the interface of used, such as layout of screen, button etc.
  • B. Design Constraints- This includes the subcomponent of the system, such as performance requirement.
  • C. Inverse Requirements- It defines that what a system can not do.
  • D. Logical Database Requirements- Data of the user are saved in this such as profile, massage,data formats, data integrity, and storage capabilities etc.
  • E. Non-Functional Requirements-This includes attributes of system, performance, security etc.

Frank is preparing a subsection of the SRS document that specifies data formats, data integrity, and storage capabilities.

Thus, the subsection which Frank is preparing for the SRS document that specifies data formats, data integrity, and storage capabilities is Logical Database Requirements.

Learn more about the SRS document here:

brainly.com/question/26161636

#SPJ1

4 0
2 years ago
Desirable characteristics of designs include:
polet [3.4K]

Answer: High cohesion

Explanation: Cohesion in general refers to make a couple of the functions or characteristics to share the functions and content . In the field of computer science , cohesion is the best characteristic that can be included in the design because it connect the  various software so that they can share the responsibilities , function and can achieve better output through this. Thus high cohesion is the most preferred factor.

8 0
3 years ago
Other questions:
  • An administrator has just added a new update to the WSUS server and she wants to test the update to the test group. Which of the
    9·1 answer
  • An email message form includes all of the following main areas except
    11·2 answers
  • A hard disk is divided into tracks which are further subdivided into:​
    11·1 answer
  • What is an identifier? Give an example of an identifier.
    13·1 answer
  • What field in a TCP segment is used to determine if an arriving data unit exactly matches the data unit sent by the source?]
    10·1 answer
  • All of the following are strategies to help you prepare for standardized test except <br>​
    5·1 answer
  • A file name extension provides what information about a file?
    6·1 answer
  • Math and science are the foundation from which drafters work<br><br> True<br> False
    8·1 answer
  • I need app ideas for basic everyday problems​
    15·1 answer
  • Chức năng của hàm MOD(number, divisor)?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!