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
natali 33 [55]
3 years ago
7

Multiple arrays. Jump to level 1 For any element in keysList with a value greater than 40, print the corresponding value in item

sList, followed by a space. Ex: If keysList = {32, 105, 101, 35} and itemsList = {10, 20, 30, 40}, print: 20 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 #include #include using namespace std; int main() { const int SIZE_LIST = 4; int keysList[SIZE_LIST]; int itemsList[SIZE_LIST]; int i; cin >> keysList[0]; cin >> keysList[1]; cin >> keysList[2]; cin >> keysList[3]; cin >> itemsList[0]; cin >> itemsList[1]; cin >> itemsList[2]; cin >> itemsList[3]; /* Your code goes here */ cout << endl; return 0; } 1 2 Check Next
Computers and Technology
2 answers:
Doss [256]3 years ago
8 0

Answer:

Replace/* Your code goes here */ with

for(int count = 0; count<4; count++)

{

if(keysList[count] > 40)

{

cout<<itemsList[count]<<" ";

}

}

Explanation;

The solution provides used an iteration to loop from the first toll the last.

The index of an array starts at 0

The index of the last element is calculated as total element - 1

Since the count of the array is 4, the last index is 4 - 1 = 3.

In the solution provides, a count integer variable is declared to iterate through the keysList array

Each element of keysList array is tested to know if it's greater than 40.

If yes the corresponding element in itemsList is printed followed by a space

Else

Nothing is done

The codes segment goes thus

for(int count = 0; count<4; count++)

{

if(keysList[count] > 40)

{

cout<<itemsList[count]<<" ";

}

}

Nesterboy [21]3 years ago
5 0

Answer:

See explaination for the details of the code.

Explanation:

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;

for(i = 0;i < SIZE_LIST;i++){

if(keysList[i] < 50){

System.out.print(itemsList[i]+" ");

}

}

System.out.println("");

}

}

You might be interested in
18) What is masking in Flash?
sammy [17]

Answer:

Ok thanks, I guess?

..............

6 0
3 years ago
thick is incorrect does anybody know the correct answer? please don’t send any files i can’t open them
77julia77 [94]

Answer:

i think its new

Explanation:

if this is incorrect i apologize

7 0
3 years ago
What is co-operating process
Greeley [361]

Answer: A process is independent if it cannot affect other process or be affected by it

Explanation:

3 0
4 years ago
With,user receive recommendations for items that are similar in type to items they already like.
Dennis_Churaev [7]

Answer:

Collaborative filtering

Explanation:

This is one out of five on the Recommender system apart from most popular items, Association and Market Basket based Analysis, Content-based analysis, self and hybrid analysis where we use both content-based and collaborative based approach together. And the Recommender system is a very important topic in Data science. For this question, remember that Collaborative filtering focuses on user and various other user's choices which are mathematically alike to concerned users, and which we find with the study of a large data set. Thus, we can predict from our above study that what are going to be likes of concerned users, and at the item level, whether that item will be liked by the concerned user or not. And this is prediction, and we use this approach in Machine learning these days. For this question, and as mentioned in question the requirements, answer is Collaborative filtering.

6 0
3 years ago
Susan wants to play softball and work after school. She cannot do both, so she decides to play softball. What is her opportunity
marta [7]
Opportunity cost is what you give up to do something else. Since she decided to play softball after school, she cannot work so the answer is B
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which is the last step in conducting a url research
    11·1 answer
  • Who is the owner of microsoft company​
    12·1 answer
  • What key do you press so you can switch tabs quickly?
    5·1 answer
  • How is a correction made to an Electronic health record?
    14·1 answer
  • 1.How does inertia affect a person who is not wearing a seatbelt during a collision?
    10·1 answer
  • Which of the following are characteristics of algorithms? Choose all that apply. They take a step-by-step approach to performing
    12·1 answer
  • You are the leader of a team at work. What type of leader would you like to be – one that gets involved and works with the team
    15·2 answers
  • Which of the following are characteristics of global variables? Check all that apply.
    5·2 answers
  • 8.1.4: Ghost Invasion!
    10·1 answer
  • What number will this code return?<br> Math.max(7, 5, 9);
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!