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
Romashka-Z-Leto [24]
4 years ago
6

For any element in keysList with a value smaller than 40, print the corresponding value in itemsList, followed by a space.

Computers and Technology
1 answer:
lidiya [134]4 years ago
3 0

Answer:

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    const int SIZE_LIST = 4;
  6.    int keysList[SIZE_LIST];
  7.    int itemsList[SIZE_LIST];
  8.    int i;
  9.    keysList[0] = 13;
  10.    keysList[1] = 47;
  11.    keysList[2] = 71;
  12.    keysList[3] = 59;
  13.    itemsList[0] = 12;
  14.    itemsList[1] = 36;
  15.    itemsList[2] = 72;
  16.    itemsList[3] = 54;
  17.    
  18.    for(i=0; i < SIZE_LIST; i++){
  19.        
  20.        if(keysList[i] < 40){
  21.            cout<<itemsList[i]<< " ";    
  22.        }
  23.    }
  24.    return 0;
  25. }

Explanation:

In the given code we have two parallel arrays with predefined values (Line 11 - 18). To check if any value from keysList below 40, create a for loop to traverse through the array and in the loop create an if statement to check the each of the keysList value (Line 20 - 22). If any value from keysList is below 40, use the current i value as an index to get the corresponding value from itemsList (Line 23) and print it out along with a single space " ".

You might be interested in
Exercise #3: Write a c++ program that reads, from a file called numbers.in, up to 10 numbers, counts and adds the positive value
Gre4nikov [31]

I don't know

Thanks for the points

3 0
3 years ago
Read 2 more answers
Which algorithm is the oldest of the tcp/ip symmetric-key algorithms?
ohaa [14]
Data Encryption Standard, or DES. 
6 0
4 years ago
Design and implement an algorithm that gets as input a list of k integer values N1, N2,..., Nk as well as a special value SUM. Y
satela [25.4K]

Answer:

Follows are the code to this question:

def FindPair(Values,SUM):#defining a method FindPair  

   found=False;#defining a boolean variable found

   for i in Values:#defining loop for check Value  

       for j in Values:#defining loop for check Value

           if (i+j ==SUM):#defining if block that check i+j=sum

               found=True;#assign value True in boolean variable

               x=i;#defining a variable x that holds i value

               y=j;#defining a variable x that holds j value

               break;#use break keyword

       if(found==True):#defining if block that checks found equal to True

           print("(",x,",",y,")");#print value

       else:#defining else block

           print("Sorry there is no such pair of values.");#print message

Values=[3,8,13,2,17,18,10];#defining a list and assign Values

SUM=20;#defining SUM variable

FindPair(Values,SUM);#calling a method FindPair

Output:

please find the attachment:

Explanation:

In the above python code a method, "FindPair" is defined, which accepts a "list and SUM" variable in its parameter, inside the method "found" a boolean variable is defined, that holds a value "false".

  • Inside the method, two for loop is defined, that holds list element value, and in if block, it checks its added value is equal to the SUM. If the condition is true, it changes the boolean variable value and defines the "x,y" variable, that holds its value.
  • In the next if the block, it checks the boolean variable value, if the condition is true, it will print the "x,y" value, otherwise, it will print a message.  

6 0
4 years ago
What is that tool that makes liquid metal? Ik I might sound dumb but I'm rlly curious
jenyasd209 [6]

Answer:

it’s called a solder. It’s used to permanently fuse two metals together. And they’re used in many different areas like construction, technology, etc.

That pic that you have i think is a computer chip or something similar.

So a solder is the tool that is used to make metal into liquid.

hope this helps and pls mark me brainliest :)

8 0
3 years ago
I need some helpppppppppopoppppppppp
Yuri [45]

Answer:

Adding images: picture drawing box and insert tab

Formatting images: crop and picture styles

Explanation:

picture drawing box and insert tab would be options to add images

formatting (or editing) the images would be crop, and picture styles

4 0
3 years ago
Read 2 more answers
Other questions:
  • Changing the color of my avatar using a computer program is ok since it doesn't impact anyone else
    12·1 answer
  • . Does Zuckerberg believe in the thought that “the endpoint is when you sell the
    15·1 answer
  • What memory stores instructions that tell the computer how to start up?
    10·1 answer
  • How to jailbreak ios 9.2 ? Is there anyway???!!!!
    12·1 answer
  • Write only in C, not C++.
    14·1 answer
  • Select the pieces of information that are added on to data to get it where it is going.
    5·1 answer
  • Look at the slide. How could the slide best be improved? By reducing the number of visual aids by increasing the font size by da
    6·2 answers
  • What is text or pictures behind the document called?​
    13·1 answer
  • your own choice Identify an organisation of whether factual of fiction with the following Consideration:The three best os to int
    14·1 answer
  • What type of email communication reaches out to former clients and older prospects and encourages a reply? Strategic email Onboa
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!