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
Karolina [17]
3 years ago
5

Write a method called equals that takes in two string arrays and returns true if they are equal; that is, if both arrays have th

e same length and contain equivalent string values at each index.
Computers and Technology
1 answer:
Sonja [21]3 years ago
8 0

Answer:

public boolean equals( String [ ] a, String [ ] b ){

       if (a.length == b.length){

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

               if ( ! a [ i ].equals( b [ i ] )) {

                   return false;

               }

           }

           return true;

       }

       return false;

   }

Explanation:

The above code has been written in Java.

// 1. Method header declaration

// Method name is <em>equals.</em>

<em>// </em>It takes in two arguments which are the two string arrays <em>a</em> and <em>b.</em>

// Since the method returns a true or false, the return type is boolean

public boolean equals( String [ ] a, String [ ] b ){

       

       // 2. Check if the two arrays are of same length

       if (a.length == b.length){       // Begin outer if statement

           

           // If they are equal in length,

           // write a for loop that cycles through the array.

           // The loop should go from zero(0) to one less than

           // the length of the array - any of the array.

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

               // At each of the cycle, check if the string values at the index which

              // is i, of the two arrays are not equal.

               if ( ! a [ i ].equals( b [ i ] )) {

                 

                   // If they are not equal, exit the loop by returning false.

                   return false;

              }

          }

          // If for any reason, the for loop finishes execution and does not

          // return false, then the two arrays contain the same string values at

          // each index. Therefore return true.

           return true;

       }                // End of outer if statement

       // If none of the return statements above are executed, return false.

       return false;

   }      // End of method.

<em>Hope this helps!</em>

You might be interested in
Which of the following topics is too broad for a 10-minute speech? A. classes offered in interior design B. the history of moder
aksik [14]
I would say it is <span> B. the history of modern interior design 
Because this subject stretches pretty far into history</span>
3 0
3 years ago
Read 2 more answers
You are trying to troubleshoot a desktop power supply issue using a voltmeter. Which of the following options are the MOST commo
vredina [299]

Answer:

The correct answers are: (A) +/- 5V and (B) +/- 12V

Explanation:

First at all, the purpose of the power supply is transforming from AC (Alternating Current) to DC (Direct Current) for use this energy in chips and electronics devices that consume this type of power. Usually the most common DC voltage for electronics is 5V but in your CPU you also have other devices that might going to need more voltage like fan or hard drives thats ´s why 12V is an also an option. Now some other devices are going to need negative sources such -5V or -12V as well.

7 0
3 years ago
Distinguished between
VladimirAG [237]

Answer:

this one is not understandable you see but I think it's better than nothing to do with it tmzr I don't know what to say to someone who did you start the morning and you can not be able to get it to

4 0
2 years ago
The scene of a human sitting at a computer terminal, responding to stimuli flashed on the computer screen, would most likely be
katrin2010 [14]

I guess the correct answer is information processing

Infοrmatiοn prοcеssing is thе changе (prοcеssing) οf infοrmatiοn in any mannеr dеtеctablе by an οbsеrvеr. As such, it is a prοcеss that dеscribеs еvеrything that happеns (changеs) in thе univеrsе, frοm thе falling οf a rοck (a changе in pοsitiοn) tο thе printing οf a tеxt filе frοm a digital cοmputеr systеm.

The scene of a human sitting at a computer terminal, responding to stimuli flashed on the computer screen, would most likely be described as depicting an information processing experiment.

7 0
2 years ago
Jack, a skillful hacker targeted a major banking services firm located in Japan, using the LOIC (Low Orbit Ion Cannon) tool, Jac
Elenna [48]

Answer:

denial-of-service attack (DoS attack) and distributed denial-of-service attack (DDoS attack)

Explanation:

Denial-of-service attack -

It is a type of cyber attack , where the hacker can create a machine or any network resource , which is capable to disrupt the server of the host , with the help of the internet , is referred to as the denial of service attack .

The task is accomplished with by flooding the host with many superfluous requests , which can overload the system .

In case of the distributed denial-of-service attack , the flooding is done by many different sources .

Hence , from the given scenario of the question ,

The correct answer is  denial-of-service attack (DoS attack) and distributed denial-of-service attack (DDoS attack) .

4 0
3 years ago
Other questions:
  • The HR department of a company wants to send out an email informing its employees about an upcoming social event. Which email ap
    11·2 answers
  • Select the proper ergonomic keyboarding techniques.
    15·2 answers
  • Page orientation can be either landscape or _____.
    13·1 answer
  • You manage an NLB cluster composed of three servers: Server1, Server2 and Server3. Your maintenance schedule indicates that Serv
    15·1 answer
  • What is the order in which windows systems receiving and process multiple gpos?
    7·1 answer
  • Justin Blake and Raegan Beast anyone?? I miss Jaegan a ton and I need a fangirl to talk to.
    13·1 answer
  • My computer just fried anybody know why it did that?
    14·2 answers
  • Computer network reduces the cost of operation​
    14·1 answer
  • How to convert meters to centimeters in c programming​
    8·1 answer
  • What are the two biggest strength as a student
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!