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
kifflom [539]
2 years ago
14

Run the program and observe the output to be: 55 4 250 19. Modify the numsInsert function to insert each item in sorted order. T

he new program should output: 4 19 55 250
Engineering
1 answer:
baherus [9]2 years ago
4 0

Answer:

The original program is as posted by the user at brainly.com/question/14102353

//Using Java

import java.util.ArrayList;

import java.util.Scanner;

public class PlayerManager {

    // Declaration

    public static void addPlayer (ArrayList<Integer> players,

int playerNum) {

     int i = 0;

     boolean foundHigher = false;

     foundHigher = false;

     i = 0;

     while ( (!foundHigher) && (i < players.size()) ) {

        if (players.get(i) > playerNum) {

   

       players.add(i, playerNum);

       

           foundHigher = true;

        }

        ++i;

     }

 

     if (foundHigher == false) {          

players.add(new Integer(playerNum));

     }

     return;

  }

  // Prints player numbers currently in ArrayList

  public static void printPlayers(ArrayList<Integer> players) {

     int i = 0;

     for (i = 0; i < players.size(); ++i) {

        System.out.println(" " + players.get(i));

     }

     return;

  }

  // Maintains ArrayList of player numbers

  public static void main (String [] args) {

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

   

     addPlayer(players, 55);

     addPlayer(players, 4);

     addPlayer(players, 50);

     addPlayer(players, 19);

   

     printPlayers(players);

     return;

//end of the program

  }

}

You might be interested in
Ai r is compressed by a 30-kW compressor from P1 to P2. The air t emperature i s maintained constant at 25oC during thi s proces
RUDIKE [14]

Answer:

The rate of entropy change of the air is -0.10067kW/K

Explanation:

We'll assume the following

1. It is a steady-flow process;

2. The changes in the kinetic energy and the potential energy are negligible;

3. Lastly, the air is an ideal gas

Energy balance will be required to calculate heat loss;

mh1 + W = mh2 + Q where W = Q.

Also note that the rate of entropy change of the air is calculated by calculating the rate of heat transfer and temperature of the air, as follows;

Rate of Entropy Change = -Q/T

Where Q = 30Kw

T = Temperature of air = 25°C = 298K

Rate = -30/298

Rate = -0.100671140939597 KW/K

Rate = -0.10067kW/K

Hence, the rate of entropy change of the air is -0.10067kW/K

3 0
3 years ago
8. Question You should never drive: When weather conditions are not ideal. When road conditions are not ideal. Without having ma
LiRa [457]
The answer is All of the above
6 0
2 years ago
Breh/bro <br><br>what is this, finally I can learn programming​
LenKa [72]

Answer:

It's an intoduction to hacking and systematic programming.

Explanation:

Yes, you might be able to grasp a few things from it, but it also may be a way hackers could hack you, by luring you to click it.

8 0
3 years ago
Jump starting a car requires _____.
maria [59]

Answer:

D

Explanation:  you need a jump cable to hook on a power source because the jump cable has two color cables to hook up to the power source. the two jump cables have two colors to tell you which one is positive and negative. The red one is the positive and the black on is the negative one.

5 0
3 years ago
Read 2 more answers
What other ways could a wildfire be contained, extinguished, or slowed down?
galben [10]
Back burning, starting fires infront of the main fire to prevent the fire from spreading and depleting fuel for the fire, digging trenches so the fire has no where to go, dropping water from planes or helicopters.
3 0
2 years ago
Other questions:
  • Explain why different types of equipment are required for proper conditioning of air
    7·1 answer
  • You are evaluating the lifetime of a turbine blade. The blade is 4 cm long and there is a gap of 0.16 cm between the tip of the
    9·1 answer
  • The 10mm diameter rod is made of Kevlar 49. Determine the change in
    7·1 answer
  • Which statements describe how the Fed responds to high inflation? Check all that apply.
    12·1 answer
  • Cavitation usually occurs because:
    15·1 answer
  • Ordan has _ 5 8 can of green paint and _ 3 6 can of blue paint. If the cans are the same size, does Jordan have more green paint
    15·1 answer
  • CAN SOMEONE GIVE ME AND ANSWER AND EXPLANTION FOR ALL THESE QUESTIONS PLEASE, I AM STRUGGLING
    15·1 answer
  • X²-12x=0 ПЖ срочно реально решите помагие ​
    9·1 answer
  • IF A CAR AHEAD OF YOU HAS STOPPED AT A CROSSWALK, YOU SHOULD:
    12·1 answer
  • At the beginning of last year, tarind corporation budgeted $1,000,000 of fixed manufacturing overhead and chose a denominator le
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!