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
sveta [45]
3 years ago
10

Write the definition of a method, isReverse, whose two parameters are arrays of integers of equal size. The method returns true

if and only if one array is the reverse of the other. ("Reverse" here means same elements but in reverse order.)
Computers and Technology
1 answer:
Marat540 [252]3 years ago
7 0

Answer:

   public static boolean isReverse(int [ ]a, int [ ]b ){

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

       {

           if(!(a[i] == b[a.length-i-1]))

               return false;

       }

       return true;

       }

Explanation:

Using a for loop, we go through the elements of the first array. The if comapres and checks if any of the values are not the same as the appropriate value on the other array, if it is so, then it is not a reverse, and we return false. else  we return true.

You might be interested in
Could anyone please answer this?
Anastaziya [24]

Answer:

D

Explanation:

The answer is D because if you're looking for lightweight materials, you'll be dealing with chemistry, and chemistry is sience.

4 0
2 years ago
How does form get its power natural gas
lana [24]

Answer:

because it does

Explanation:

7 0
2 years ago
Melissa is writing a class called Cell. Which method has she set up to return a double?
Alina [70]

Answer:

C. public double get_mCount()

5 0
3 years ago
Write the following function without using the C++ string class or any functions in the standard library, including strlen(). Yo
dolphi86 [110]

Answer:

The function in C++ is as follows

int chkInd(string str1, string str2){    

int lenstr1=0;

while(str1[lenstr1] != '\0'){  lenstr1++;  }

int index = 0; int retIndex=0;

for(int i=lenstr1-1;i>=0; i--){

   while (str2[index] != '\0'){

       if (str1[i] == str2[index]){

           retIndex=1;

           break;         }

       else{   retIndex=0;      }

  index++;    }

  if (retIndex == 0){   return i;   }else{return -1;}}

}

Explanation:

This defines the function

int chkInd(string str1, string str2){    

First, the length of str1 is initialized to 0

int lenstr1=0;

The following loop then calculates the length of str1

while(str1[lenstr1] != '\0'){  lenstr1++;  }

This initializes the current index and the returned index to 0

int index = 0; int retIndex=0;

This iterates through str1

for(int i=lenstr1-1;i>=0; i--){

This loop is repeated while there are characters in str2

   while (str2[index] != '\0'){

If current element of str2 and str1 are the same

       if (str1[i] == str2[index]){

Set the returned index to 1

           retIndex=1;

Then exit the loop

           break;         }

If otherwise, set the returned index to 0

       else{   retIndex=0;      }

Increase index by 1

  index++;    }

This returns the calculated returned index; if no matching is found, it returns -1

  if (retIndex == 0){   return i;   }else{return -1;}}

}

4 0
3 years ago
Need Help! Asap 7.5 code practice (Edhesive)
erma4kov [3.2K]

Answer:

Make main function

def main():

Make some constants for the grades

A = 5.0 or 4.0

B = 4.0 or 3.0

C = 3.0 or 2.0

D = 2.0 or 1.0

F = 1.0 or 0.0

In the main function call the function you made and make sure to use those constants for help

also don't forget to call your main function or nothing will work

Explanation:

Making the main function is good programming practice for your future

Making the constants is also helpful to your programming.

Now how it works you call the function you wrote to calculate the grade.

I don't know how helpful this was this is one of my first answers. I am `also answering how I would do it

5 0
2 years ago
Read 2 more answers
Other questions:
  • Which of the following would be considered a strong password?
    5·2 answers
  • What 2 major agricultural inventions did jethro tull create?
    10·2 answers
  • Virtual private network requires a secure remote connections<br><br> true or false?
    11·1 answer
  • What is the main characteristic of a Peer-to-Peer (P2P) network?
    8·1 answer
  • How do you put a picture when you ask a question?
    6·2 answers
  • What is emerging as a major business area of innovation that offers a flexible collection of computers on the internet that can
    6·1 answer
  • Which text features does this section contain? Check all that apply.
    15·1 answer
  • Open the NetBeans IDE and create a new project named MySizes.java. Your program should do the following:
    9·1 answer
  • How Powerpoint is useful in education aspect?
    5·2 answers
  • What option in the zone aging/scavenging properties dialog box will prevent dns record time stamps from being updated too often?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!