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
Ket [755]
2 years ago
10

Write a method named removeRange that accepts an ArrayList of integers and two integer values min and max as parameters and remo

ves all elements values in the range min through max (inclusive). For example, if an ArrayList named list stores [7, 9, 4, 2, 7, 7, 5, 3, 5, 1, 7, 8, 6, 7], the call of removeRange(list, 5, 7); should change the list to store [9, 4, 2, 3, 1, 8
Computers and Technology
1 answer:
telo118 [61]2 years ago
5 0

Answer:

Answered below

Explanation:

public ArrayList<Integer> removeRange(ArrayList<Integer> X, int min, int max){

int i; int j;

//Variable to hold new list without elements in //given range.

ArrayList<Integer> newList = new ArrayList<Integer>();

//Nested loops to compare list elements to //range elements.

if(max >= min){

for( i = 0; i < x.length; I++){

for(j = min; j <= max; j++){

if( x [i] != j){

newList.add( x[i] );

}

}

}

return newList;

}

}

You might be interested in
________ is a process where authentication and permission will be passed on from one system to another, usually across multiple
hoa [83]

Answer: Federation

Explanation:

In multiple enterprises there are number of authentication processes to access resources and information so in order to avoid a large number of authentications we have a process called federation whereby all the authentication and authorization processes are passes from one system to the other within the enterprise.

3 0
2 years ago
Write a method that takes a RegularPolygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclus
Sergio [31]

Answer:

import java.lang.Object

import java.lang.Math

public class RegularPolygon  extends java.lang.Object{

  public void randomize(RegularPolygon c){

       int min = 10, max1 = 20;

       double  min1 = 5, max1 = 12;

       double range = (max - min) + 1;

       double range1 = (max1 -min1) + 1

       int side = (Math.random() * range) + min;

       double len = (Math.random() * range1) + min1;

       c.setNumSides(side);

       c.setSideLength( len);

 }

 public static void main(String[] args) {

    RegularPolygon r = new RegularPloygon();

    randomize(r);

 }

}

Explanation:

The randomize method accepts a regular polygon class as its only parameter and assigns a random number of sides and the length of these sides with the 'Math.random' function.

5 0
3 years ago
1.5 question 3 on edhesieve
morpeh [17]

Answer:

ppl

Explanation:

asfafgdffsghsdfghdgsghdfghtrbd54445 ddfgg

7 0
3 years ago
The size of the board is one of the differences between Elevens and Thirteens. Why is size not an abstract method?
Levart [38]

Answer:

The program keeps track of the size of the board in cards.size(). The sub class sets this by passing it into the constructor. After that, the subclass never cares about the size of the board, so it's not necessary to make it accessible with an abstract method. Any need for it is covered by cardIndexes method.

Explanation:

The differences between Elevens and Thirteens

The program keeps track of the size of the board in cards.size(). The sub class sets this by passing it into the constructor. After that, the subclass never cares about the size of the board, so it's not necessary to make it accessible with an abstract method. Any need for it is covered by cardIndexes method.

5 0
3 years ago
Select the word or phrase from the drop-down menu to complete each sentence. File names consist of a ______ and a file extension
Law Incorporation [45]

Answer:

base file name, file format, bitmap image

Explanation:

8 0
2 years ago
Other questions:
  • Which type of network cover a large geographical area and usually consists of several smaller networks, which might use differen
    5·1 answer
  • In cell R9, enter a formula using the AVERAGEIF function to determine the average number of years of experience for lifeguards.
    12·1 answer
  • If 10 ft lb of torque is applied at gear A, then what is the output torque at gear D?
    15·1 answer
  • Multiple Choice
    6·1 answer
  • (15 POINTS) When an error is made in HTML code, the browser does what?
    11·1 answer
  • What is the output of the following program?
    10·1 answer
  • fill in the balenkes ) 1)there are ................................... function keys on the keybord 2)pressing the end key moves
    6·1 answer
  • Which of the following are characteristics of global variables? Check all that apply.
    5·2 answers
  • Write a function (subroutine) that inputs a data value in register r0 and returns value in r0. The function returns y 5 a 1 bx 1
    15·1 answer
  • Select three physical forms of storage. USB drive Primary cache Magnetic storage Secondary cache Dynamic RAM Optical drive
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!