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]
3 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]3 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
What term is used to describe a chipset developed and promoted by the U.S. government from 1993 to 1996 as an encryption device
Flauer [41]

Answer:

Clipper Chip Kerberos National Information Infrastructure (NII)

Explanation:

The Clipper chip was developed by the NSA (National Security Agency) for enciphering and deciphering messages. It was promoted for voice transmission in telecommunications companies. The Clipper chip was announced in 1993, not all consumers and manufacturers embraced it and only last to 1996.

3 0
3 years ago
12.2 Sort an array in ascending order Write a program that gets a list of integers from input, and outputs the integers in ascen
notsponge [240]

Answer:

Explanation:

The following code is written in Java, it asks the user for the number of inputs that will be made and then the inputs. These inputs are placed into an array. Then the array is sorted and printed out to the terminal.

public static void sortArrayList() {

           ArrayList<Integer> sortedList = new ArrayList();

           Scanner input = new Scanner(System.in);

           System.out.println("Enter number of digits in Array");

           int numberOfInputs = input.nextInt();

           for (int i = 0; i < numberOfInputs; i++) {

                   System.out.println("Enter a number");

                   sortedList.add(input.nextInt());

           }

           int n = sortedList.size();

           for (int i = 0; i < n; i++)

               for (int j = 0; j < n-i-1; j++)

                   if (sortedList.get(j) > sortedList.get(j + 1))

                   {

                       // swap arr[j+1] and arr[j]

                       int temp = sortedList.get(j);

                       sortedList.set(j, sortedList.get(j + 1));

                       sortedList.set(j + 1, temp);

                   }

           for (int x : sortedList) {

               System.out.println(x);

           }

       }

7 0
3 years ago
Public places where you can wirelessly connect to the internet are known as wifi ________.
AleksAgata [21]

<span>Answer - Hotspots</span>

<span>
</span>

<span>Public places where you can wirelessly connect to the internet are known as Wi-Fi hotspots. Common Wi-Fi hotspot locations (where wireless internet connection is offered) include such places as cafes, hotels, airports, and libraries. These businesses usually create hotspots for the use of their customers.</span>

8 0
4 years ago
JAVA
avanturin [10]

Answer:

   public ArrayList onlyBlue(String[] clothes){

       ArrayList<String> blueCloths = new ArrayList<>();

       for(int i =0; i<clothes.length; i++){

           if(clothes[i].equalsIgnoreCase("blue")){

               blueCloths.add(clothes[i]);

           }

       }

       return blueCloths;

   }

Explanation:

  • Create the method to accept an Array object of type String representing colors with a return type of an ArrayList
  • Within the method body, create and initialize an Arraylist
  • Use a for loop to iterate the Array of cloths.
  • Use an if statement within the for loop to check if item equals blue and add to the Arraylist.
  • Finally return the arrayList to the caller
3 0
3 years ago
When a machine is having issues, an IT Support Specialist has to file an RMA, or Return Merchandise Authorization form, with the
melamori03 [73]

Answer:

The answer is "Option b"

Explanation:

This method is also known as the model is continuously developed, evaluated, applied and enhanced. It enables firms to manage transactions with its all-out returns, they can be used to calculate the final 7 digits of the Online charge level, and the wrong option can be described as follows:

  • In option a, It first find then arranging all the data.  
  • In option c, It provides essential updates and saves into the file.
  • In option d, It is an ideal plan for a lifetime operation.
5 0
3 years ago
Read 2 more answers
Other questions:
  • How long does it take to wire a house?
    14·2 answers
  • Look at the following form. Which input method is the form using to receive the user's favorite activity? What is your favorite
    12·2 answers
  • If you see an icon in a document preset that looks like a tiny web browser window, what type of document is the preset meant to
    13·1 answer
  • What is the disadvantages of using proprietary software
    10·2 answers
  • The operating system’s application programming interface (API) provides software developers with tools they use to build applica
    5·1 answer
  • Please tell me what is basic HTML tags and its function please ​
    8·1 answer
  • Within a major students can choose to study a specific area within major. For example a journalism student may study military jo
    8·1 answer
  • Having friends who cause you stress can decrease your happiness, which can in turn
    13·2 answers
  • Program Convert Measurements:
    15·1 answer
  • How do you remove a key cap without a kaycap remover (keyboard keycap) ​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!