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
eduard
3 years ago
11

Write a method called removeInRange that accepts four parameters: an ArrayList of integers, an element value, a starting index,

and an ending index. The method's behavior is to remove all occurrences of the given element that appear in the list between the starting index (inclusive) and the ending index (exclusive). Other values and occurrences of the given value that appear outside the given index range are not affected. For example, for the list [0, 0, 2, 0, 4, 0, 6, 0, 8, 0, 10, 0, 12, 0, 14, 0, 16], a call of removeInRange(list, 0, 5, 13); should produce the list [0, 0, 2, 0, 4, 6, 8, 10, 12, 0, 14, 0, 16]. Notice that the zeros located at indices betwee
Computers and Technology
1 answer:
Murrr4er [49]3 years ago
7 0

Answer:

public static void removeInRange(List<Integer> list, int value, int start, int end) {

       for (int i = end - 1; i >= start; i--) {

           if (list.get(i) == value) {

               list.remove(i);

           }

       }

       System.out.println(list);

   }

Explanation:

- Create a method named <em>removeInRange</em> that takes four parameters, a list, an integer number, a starting index and an ending index

- Inside the method, initialize a <u>for loop</u> that iterates between starting index and ending index

- If any number between these ranges is equal to the given <em>value</em>, then remove that value from the list, using <u>remove</u> method

- When the loop is done, print the new list

You might be interested in
This type of server spools documents and puts them in a queue.
Paraphin [41]

Print is the type of server that spools documents and puts them in a queue. Whenever you are printing multiple documents, it is the standard operation of the printer to prioritize those documents that came first and add to the queue the other documents waiting for printing.

4 0
3 years ago
Compter History Large Resume Include: the beginnings of the computer and its development during the years The events of computer
NikAS [45]

Answer:

The development of computers from the beginning to what we see now is called the computer generations. It is gradual advancement in the technology in the making of the computer.

Explanation:

The generation in computer technology can be defined as the development or the change in the technology in the computer as it was used. There were  five generations of computer development. They were :

1. First Generation computers

   In this generation, vacuum tubes was used in the circuits. It dated from 1946 to 1959.

2. Second Generation computers

  These are transistors based computers. This generation ranges from 1959 to 1965.

3. Third Generation computers  

    This generation computers were Integrated circuit based. The generation stared in 1965 and ended in 1971.

4. Fourth Generation computers

   The computers of this generation used VLSI microprocessor in the circuits. The period of the 4th generation computers are from 1971 to 1980.

5. Fifth Generation computers

   The computers of this generation used ULSI microprocessor in the circuits. The 5th generation computers started from 1980s.

4 0
2 years ago
Write java code to create a new class called "student". an object of the student class has attributes like student id, name and
Fiesta28 [93]
Here you go. I added a constructor and a toString overload to make the object creation and printing as easy as possible.

public class student {
    private String _id;
    private String _name;
    private String _address;

    public student(String id, String name, String address) {
        _id = id;
        _name = name;
        _address = address;
    }

    public String toString() {
        return "Id: " + _id + "\nName: " + _name + "\nAddress: "+ _address;
    }

    public static void main(String[] args) {
        student s1 = new student("S12345", "John Doe", "Some street");
        System.out.println(s1);
    }
}

8 0
2 years ago
Guys how do i add or insert a diagram for similarities on google docs.
Vikki [24]
Usually I go to the Photos and I find a photo that already had the diagram
7 0
2 years ago
SOMEBODY HELP ME ASAP PLEASE AND THANK YOU<br> No LiNkS PlEaSe I wIlL RePoRt ThE LiNKs
Lera25 [3.4K]

Answer:

I don't understand what the question is asking

Explanation:

8 0
2 years ago
Read 2 more answers
Other questions:
  • If you wish to maintain a consistent style to all the documents you create, it would be helpful to use a _____.
    10·1 answer
  • What does PHP stand for?
    9·2 answers
  • How many seconds are required to make a left turn and join traffic?​
    11·2 answers
  • The steps for moving data from one cell to another are _____.
    14·1 answer
  • What is the best option for sharing Word documents on a Microsoft network because it provides finer degrees of versioning contro
    6·1 answer
  • Which of the following is a subsystem of computers providing access to the Internet and offering multimedia and linking capabili
    13·1 answer
  • Czy FALL GUYS będzie działało szybko na i5 GH8? Na ilu FPS?
    13·1 answer
  • Mr. Simmons has assigned a research project. Every student in the class will create a single page report about the recycling hab
    15·1 answer
  • You are starting a small web hosting business and
    11·1 answer
  • What is Cloud computing? Explain briefly
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!