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
Two different ways to bring up My Computer folder
seraphim [82]
On a Windows PC, My Computer is a folder on the desktop. Alternatively, you can click on Start and access My Computer from that menu.
5 0
3 years ago
I stole you pokemon cards :o
Mademuasel [1]

Answer:

no not my prize possessions it took me years to get them

4 0
3 years ago
Read 2 more answers
The use of computers to combine data from multiple sources and create electronic dossiers of detailed information on individuals
valkas [14]
Data compilation I believe
4 0
3 years ago
What job does a front-end developer perform?
alina1380 [7]

Answer:

They manage making websit/es beautiful. Basically how brainly is setup? The layout is nice? Front end developers are responsible for why webpages look pretty or nicely done. <em>fun fact, my dream job is a front end developer!</em>

5 0
2 years ago
Function prototypes and function definitions look similar because they have the same function heading. In a function prototype t
hjlf

Answer:

In a function prototype the heading is followed by a semicolon, whereas in a function definition the heading is followed by a function block.

Explanation:

As the function prototype only declares the function and the function definition defines the operations in the function.

e.g:

add(int x, int y);  is the prototype

add(int x, int y)

{

     int sum;

     sum = x+y;

}    is the function definition.

3 0
3 years ago
Other questions:
  • The term ________ refers to the use of a single unifying device that handles media, Internet, entertainment, and telephone needs
    7·1 answer
  • You have a large dataset that will print on several pages. You want to ensure that related records print on the same page with c
    11·1 answer
  • Were does igneous rocks cool?
    9·1 answer
  • Why must you be careful when handling a hard drive?
    10·1 answer
  • Why computer literacy is vital to access in business work
    7·1 answer
  • Consider the following declaration:
    9·1 answer
  • Write the two features of a mouse.​
    9·1 answer
  • Why did Elena Gilbert Turn her humanity off when she was sired to Damon? (In The Vampire Diaries)
    14·1 answer
  • What is the answer in music class
    6·1 answer
  • Write a while loop that continues to increment uservalue by 5 as long as uservalue is less than 0.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!