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
Design and implement a program to display each directory entry information (files and directories) of current directory, and wit
FromTheMoon [43]

Answer: The code below can display directory as stated in the question

Explanation:

char *

gnu_getcwd ()

{

 size_t size = 100;

 while (1)

   {

     char *buffer = (char *) xmalloc (size);

     if (getcwd (buffer, size) == buffer)

return buffer;

     free (buffer);

     if (errno != ERANGE)

       return 0;

     size *= 2;

   }

}

3 0
3 years ago
What happens to energy as we move from step to step in a chain or web
scZoUnD [109]

Answer:Energy decreases as it moves up trophic levels because energy is lost as metabolic heat when the organisms from one trophic level are consumed by organisms from the next level.

Explanation:

6 0
3 years ago
To make a duplicate of text, image,chart,graphs etc.​
Veronika [31]

Explanation:

You can change the formatting of the rest of the text ( bold, italics, font color or sixe, ect)

5 0
3 years ago
A cookie recipe calls for the following ingredients:
Romashka [77]

def cookie_Recipe(recipe):

   

   sugar=(0.03125*recipe)

   butter=(0.02083333333*recipe)

   flour=(0.05729166666*recipe)

   LF1=round(sugar, 2)

   LF2=round(butter,2)

   LF3=round(flour, 2)

   print("You will need:")

   print(LF1, "cups of sugar")

   print(LF2, "cups of butter")

   print(LF3, "cups of flour")

   print("To make", recipe, 'cookies')

recipe=int(input("How many cookies do you want to make?\n"))

cookie_Recipe(recipe)

4 0
3 years ago
The process that prepares a data model for implementation as a simple, nonredundant, flexible and adaptable database is known as
Vera_Pavlovna [14]

Answer:

The process that prepares a data model for implementation as a simple, nonredundant, flexible and adaptable database is known as

C) data analysis.

Explanation:

Data analysis is a process used in critically examining, evaluating data by using logical and statistical techniques.

Data analysis helps in the discovery of important information, data that can be used in the final decision making. the types of data analysis we have are:

*Prescriptive Analysis.

*Descriptive Analysis.

*Predictive Analysis.

*Diagnostic Analysis.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Outline the steps necessary to prepare a storage device for storing files. Identify and briefly describe the tools used to prepa
    7·1 answer
  • You can use the results from a search on a database in all of these ways except to ____.
    11·2 answers
  • Jennifer has written a business report. What should be her last step before she submits the story for publication?
    10·2 answers
  • You have several marketing documents that are published through AD RMS. However, you have three new marketing employees that req
    12·1 answer
  • If I had to choose the class I prefer it would be a
    10·1 answer
  • Write a programmer defined function that compares the ASCII sum of two strings. To compute the ASCII sum, you need to compute th
    6·1 answer
  • // Exercise 4.16: Mystery.java
    6·1 answer
  • Because of the internet, travel agents now focus more on computers than they do on customer relationships.
    6·2 answers
  • HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP!!!
    12·1 answer
  • ____ storage is not recommended for long-term archiving because the storage media can degrade over time
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!