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
you just bought a new hard drive for your computer .you plan to use this as a secondary hard drive to store alll your files. wha
marin [14]
In case the first drive fails, the data will all be backed up onto the second drive, a copy will still be intact.
7 0
3 years ago
In this lab, you complete a prewritten Python program for a carpenter who creates personalized house signs. The program is suppo
ivolga24 [154]

Using the computer language in python to write a function code that personalized house signs

<h3>Writting the code in python:</h3>

<em>#Assign varibles</em>

<em>charge = 0.00</em>

<em>numChars = 8</em>

<em>color = "gold"</em>

<em>woodType = "oak"</em>

<em />

<em>#Checking for number of characters</em>

<em>if numChars > 5:</em>

<em>charge = 35 + (numChars-5)*4</em>

<em>elif numChars > 0:</em>

<em>charge = 35</em>

<em />

<em>#Checking wood type</em>

<em>if woodType == "oak":</em>

<em>charge += 20</em>

<em />

<em>#Checking for color</em>

<em>if color == "gold":</em>

<em>charge += 15</em>

<em />

<em>#Print output</em>

<em>print("The charge for this sign is $"+str(charge)+".")</em>

See more about python at brainly.com/question/13437928

#SPJ1

5 0
1 year ago
____ 59. Suppose that x and y are int variables, ch is a char variable, and the input is: 4 2 A 12 Choose the values of x, y, an
Vlada [557]

Answer:

d. This statement results in input failure.

Explanation:

We are taking input of 3 variables only and those are x,ch,and y. cin is a C++ keyword used take input entered by the user onto the screen cin is not a variable.

The input should of type int char int as written in the code. First is x and character variable ch and then the integer variable y and there should be only three inputs.

8 0
3 years ago
Read 2 more answers
Use ordinary pipes to implement an inter-process communication scheme for message passing between processes. Assume that there a
Naya [18.7K]

Answer:

Yup

Explanation:

6 0
3 years ago
What is the output by: <br> print(len(stuff))
svetlana [45]

Answer:

The output will print out whatever the length is for stuff.

Explanation:

You use len() to get the length of the given string, array, list, tuple, dictionary, etc. Thus, passing in stuff using len will let the program to get the length of it.

7 0
2 years ago
Other questions:
  • Erick, who is taking an online course, sent an e-mail to his
    14·2 answers
  • What microprocessor was the first to be processable<br> ?
    14·1 answer
  • What bus carries a status signal back to the CPU?
    14·1 answer
  • A location in memory used for storing data and given a name in a computer program is called a because the data in the location c
    14·1 answer
  • to add data to to a chart, you must format data from another microsoft office product, that automatically opens. whats the name
    10·1 answer
  • Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both sing
    10·1 answer
  • Which of the following statements is NOT true regarding​ ERP? A. ERP promises​ slow, but​ accurate, information. B. ERP allows c
    11·2 answers
  • Apex
    5·2 answers
  • PLEASE HELP How have phones made us spoiled? How have phones made us unhappy?
    10·1 answer
  • Giusp minfg gấp vs ạ đáp án thôi nhé
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!