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
Vanyuwa [196]
3 years ago
15

Write a method named lastIndexOf that accepts an array of integers and an * integer value as its parameters and returns the last

index at which the * value occurs in the array. The method should return -1 if the value is not * found.
Computers and Technology
1 answer:
evablogger [386]3 years ago
7 0

Answer:

The method is as follows:

public static int lastIndexOf(int [] numbers, int num){

    int lastIndex = numbers[0];

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

        lastIndex = numbers[i];

    }

    return lastIndex;

}

Explanation:

This defines the method

public static int lastIndexOf(int [] numbers, int num){

This initializes the lastIndex to the first element of the array

    int lastIndex = numbers[0];

This iterates through every "num" element of the array

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

This gets the current index... until the last

        lastIndex = numbers[i];     }

This returns the last

    return lastIndex; }

You might be interested in
It is considered good practice to save a presentation before printing it. true false
Ilya [14]
It is true because it is really a good practise to save a presentation before printing it

5 0
3 years ago
Thomas Hill claims that a fruitful way to think about the badness of destroying the environment is
viktelen [127]
To think about what kind of human would choose to destroy the earth.To appeal to theories about God and care for the earth.To examine people’s intuitions about whether it is right to harmthe environment.To examine the rights that belong to the environment and act on<span>the basis of those rights</span>
3 0
3 years ago
What happens when a filter is applied to a database?
Genrish500 [490]
Hello there.

<span>What happens when a filter is applied to a database?

</span><span>Some records are permanently removed from the database.
</span>
5 0
3 years ago
List &amp; briefly explain 5 benefits of having a Business bank account.
oee [108]

Answer:  down there

Explanation:

Some other benefits come from establishing a business bank account. You can gain access to services that make life easier, such as merchant account and payroll services, free online banking and, importantly, easier access to small business loans.

3 0
3 years ago
Read 2 more answers
What is cognitive overload?
kogti [31]

Answer:

C

Explanation:

C mentions the brain being overloaded

3 0
3 years ago
Read 2 more answers
Other questions:
  • - The __________ is called a single-selection statement.
    10·1 answer
  • If you wanted to insert pictures into a presentation which tab would you use
    6·2 answers
  • A(n)…………is the interface used toconnect external devices to the computer.
    5·1 answer
  • which of these can a worksheet within a spreadsheet contain? a.a chart b.data c.multiple charts d.all of these
    7·2 answers
  • How will you -
    9·1 answer
  • CHEMISTRY. metal+water》base+...............​
    12·1 answer
  • Briefly describe the concept of network topology change and explain how these can be dealt with using Routing Information Protoc
    9·1 answer
  • NEED HELP ASAP!!!!!!!!!!
    10·2 answers
  • Do you ever wonder what types of media you will be using five years from now or when you graduate from college or a training pro
    9·1 answer
  • Select the correct answer. Nancy has made a small web page with the new features of HTML5. She has to show this web page in scho
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!