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
Sunny_sXe [5.5K]
2 years ago
14

Pass the two arrays to a method that will display the integer value(s), if any, that appear in both arrays (note that the two ar

rays can have no stored values in common). Save the file as ArrayMethodDemo.java.
Computers and Technology
1 answer:
vampirchik [111]2 years ago
5 0

Answer:

The solution code is written in Java

  1.    public static void checkCommonValues(int arr1[], int arr2[]){
  2.        if(arr1.length < arr2.length){
  3.            for(int i = 0; i < arr1.length; i++){
  4.                for(int j = 0; j < arr2.length; j++){
  5.                    if(arr1[i] == arr2[j]){
  6.                        System.out.print(arr1[i] + " ");
  7.                    }
  8.                }
  9.            }
  10.        }
  11.        else{
  12.            for(int i = 0; i < arr2.length; i++){
  13.                for(int j = 0; j < arr1.length; j++){
  14.                    if(arr2[i] == arr1[j]){
  15.                        System.out.print(arr2[i] + " ");
  16.                    }
  17.                }
  18.            }
  19.        }
  20.    }

Explanation:

The key idea of this method is to repeated get a value from the shorter array to check against the all the values from a longer array. If any comparison result in True, the program shall display the integer.

Based on this idea, an if-else condition is defined (Line 2). Outer loop will traverse through the shorter array (Line 3, 12) and the inner loop will traverse the longer array (Line 4, 13). Within the inner loop, there is another if condition to check if the current value is equal to any value in the longer array, if so, print the common value (Line 5-7, 14-16).

You might be interested in
You would like to conduct a survey and ask your web page visitors to indicate the computer operating systems that they use. Each
satela [25.4K]

Answer:

<em>A checkbox</em>

Explanation:

A checkbox <em>(check box, tick box, tick box) is an User interface widget that allows the user to choose a binary option.</em>

Like a choice between any of two potential options that are mutually exclusive.

For instance, on a simple yes / no question, the user may have to answer ' yes ' (checked) or ' no ' (not checked).

7 0
3 years ago
You are part of a testing team at a software business. Your job is to see how many concurrent users the system can host and how
damaskus [11]

Answer:

The right approach is Option b (volume testing).

Explanation:

  • A non-functional trial that has been conducted throughout a results evaluation where even a large amount of information becomes accessible to something like the program, would be determined as Volume testing.
  • The application functionality has been analyzed by determining the maximum volume throughout the database.

Other options are not related to the given query. So the above is the right response.

5 0
2 years ago
Jameelah has files all over her computer. Thus, it is often difficult for her to find the files she is looking for.
VLD [36.1K]

Answer:

folders

Explanation:

it is a very good way to keep your desktop organized and keep tidy

3 0
3 years ago
What term is commonly used to refer to HTML formatting?
yanalaym [24]

Answer: No particular term

Explanation:

If by formatting you are referring to the presentation of the html page or website means how the forntend looks then css is used. In case of text formatting then bold <b><b/> italic <i></i> small <small></small> superscript <sup></sup> subscript <sub></sub> etc tags available

6 0
3 years ago
Who is the Queen of rap?
mote1985 [20]

Answer:

A. Nicki Minaj

only valid answer but every1 else is good too!

5 0
2 years ago
Other questions:
  • Tricia listed her assets and liabilities. Credit Card Bill Car Loan Bonds Piano Bank Account Bicycle Which are Tricia’s liabilit
    8·2 answers
  • Recording relative positions should reduce total programming time true or false
    7·1 answer
  • Casual or informal group meetings are common. Here youcasually chat over tea, meet after work, or get together for purelysocial
    5·1 answer
  • What should you do if your temperature gauge moves up to just below the red zone?
    10·2 answers
  • If you've been a victim of identity theft, what should you do after contacting the company that reported the suspicious charge a
    9·1 answer
  • Panes created using the vertical split bar scroll together horizontally. true or false.
    12·1 answer
  • We introduced Sudoku as a CSP to be solved by search over
    13·1 answer
  • What is the value of 8n when n= = 2?​
    13·1 answer
  • Listed here are a few camera angles and their images.
    10·1 answer
  • how could environmental and energy problem Kenya faces as far computer installations are concerned be avoided​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!