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
Write a program that accepts two numbers R and H, from Command Argument List (feed to the main method). R is the radius of the w
nasty-shy [4]

Answer:

Answered below.

Explanation:

#Answer is written in Python programming language

#Get inputs

radius = float(input("Enter radius in inches: "))

height = float(input("Enter height in feet: "))

#Convert height in feet to height in inches

height_in_inches = height * 12

#calculate volume in cubic inches

volume = 3.14 * (radius**2) * height_to_inches

#convert volume in cubic inches to volume in gallons

volume_in_gallons = volume * 0.00433

#output result

print (volume_in_gallons)

7 0
2 years ago
A file with a com extension is most likely to be a(n) ___ file.
olasank [31]
I think that the answer is: A executable
4 0
3 years ago
Read 2 more answers
Your personal opinion about what a "successful" console in the future will need to include to sell well. How have the changes in
Marizza181 [45]

Answer:

The answer is below

Explanation:

In my personal opinion what a "successful" console in the future will need to include to sell well is "a big library of games." This feature will help a console supports many games that will appeal to all categories of gamers.

The changes in technology, gaming culture, and overall society has affected the game market in many ways such as:

1. In terms of technology: it has made the game manufacturers both the console and third-party game developers to improve their gaming features. For example, the advancement in gaming pads becoming wireless. The gaming console having internet or online features, where gamers can play with each other around the world from their rooms. Also, the gaming character design looking more and more like the real-life personality it represents.

2. In terms of gaming culture: modern games are no longer for teenagers alone. It is now appealing to adults as well. This is evident in football players and coaches playing the games and talking about it. Even some players tend to influence their ratings in the game by mentioning how good they are in the press in comparison to the rating game developers are giving them.

3. Overall society has now seen gaming consoles as part of everyday life. The parents, researchers, and even feminist groups are now well aware of the gaming industry. And each of the stakeholders involved is influenced by how the game consoles manufacturers market their games through media, sports personalities, celebrities, etc.

4 0
3 years ago
A _____ is usually a smaller version of a data warehouse
Strike441 [17]
A ( micro ) is usually a smaller version of a data warehouse
4 0
2 years ago
Jane Estroisch works as a manager in a multidomestic firm. She focuses on the long-term questions facing the organization such a
navik [9.2K]

Answer:

b

Explanation:

Tactical. Perhaps she needs yo keep in touch with the board of directors in order to make an strategic planning.

3 0
2 years ago
Other questions:
  • Hardy doesn't have access to a work template, which is on the network server. What should he do?
    14·1 answer
  • Which would increase electric current? increasing the resistance increasing the size of the wire decreasing the voltage
    6·1 answer
  • ________ is a dedicated device designed to manage encrypted connections established over an untrusted network such as the Intern
    12·1 answer
  • What is the function of the command prompt?
    8·1 answer
  • Write the definition of a class Clock. The class has no constructors and three instance variables. One is of type int called hou
    12·1 answer
  • Riya wants to save her project work in an external device so that she can show it to her class teacher. Help her to choose the d
    13·2 answers
  • Piers wants to take a course on XML. He is a certified web designer, but he has not used XML before. How can he use XML to impro
    8·1 answer
  • Which of the following statements best reflects the pros and cons of overtime potential for a line installer or repairer?
    15·1 answer
  • Sabiendo que z1 = 10, z2 = 20, z3 =10 , z4 = 20, n1 = 1200 rpm.
    6·1 answer
  • Give three examples of NON-TRADITIONAL web authoring tools<br> 3 pour
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!