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]
2 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]2 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
Type the correct answer in the box. Spell the word correctly.
fomenos

Answer:

"a callout is a type of text box that also includes a line for pointing to any location on the document. A callout appears under the SHAPES menu of the word processing program. The answer that completes this statement is the word "shapes". Hope this answers your question."

Explanation:

8 0
3 years ago
Read 2 more answers
Hi I m from India plz follow me and I will follow u​
erma4kov [3.2K]

Answer:

pok

Explanation:

4 0
3 years ago
Read 2 more answers
Which collaboration website is best suited for social collaboration? www.media.iearn.org/projects www.meetup.com www.quest.nasa.
olga55 [171]
The first option is the correct answer
6 0
3 years ago
What is the primary uses of cell phone
den301095 [7]

Some primary uses of cell phones include, keeping in touch with friends or family. As well as communicating to work and to have in the event of an emergency.

8 0
3 years ago
Read 2 more answers
What report shows which types of mobile devices visited a website?.
Lerok [7]

Answer:

Technology > Network report. All traffic > Source/Medium report.

Explanation:

hope this helps

8 0
1 year ago
Other questions:
  • For Adults/Adolescents, you should call/activate EMS: Before providing CPR. After providing CPR for 2 minutes. After an AED has
    13·1 answer
  • The programming interface between an application program and the dbms is usually provided by the
    13·1 answer
  • Select five system utility functions.
    11·1 answer
  • Describe the differences between program development and program execution, including the installed software required for develo
    5·1 answer
  • Lazarus Consulting is a large computer consulting company in New York. Pete Lazarus, theà CEOà and founder, is well known for hi
    8·1 answer
  • When targeting customers of the consumer population at market a product, what type of segmentation information would be most hel
    12·2 answers
  • Mrs. Schlair has an annual salary of $96,402.<br> a. What would her semimonthly salary be?
    9·1 answer
  • Which option should you choose to change the background of your current slide?
    10·2 answers
  • How do you put text in MS publisher?<br><br> When do you use text wrapping?
    14·1 answer
  • The scope of a temporary table is limited to what?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!