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]
3 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]3 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
A motorist enters a freeway at 25 mi/h and accelerates uniformly to 65 mi/h. From the odometer in the car, the motorist knows th
Helga [31]

Answer:

a) 2.2 m/s² b) 8 s

Explanation:

a) Assuming that the acceleration is constant, we can use any of the kinematic equations to solve the question.

As we don´t know the time needed to accelerate, we can use the following equation:

vf2 – vo2 = 2*a*∆x

At first, we can convert the values of vf, vo and ∆x, to SI units, as follows:

vf = 65 mi/h* (1,605 m / 1mi) * (1h/3,600 sec) = 29 m/s

vo = 25 mi/h *(1,605 m / 1mi) * (1h/3,600 sec) = 11.2 m/s

∆x = 0.1 mi*(1,605 m / 1mi) = 160.5 m

Replacing these values in (1), and solving for a, we have:

a = (29 m/s – 11.2 m/s) / 321 m = 2.2 m/s2

b) In order to obtain the time needed to reach to 65 mi/h, we can rearrange the equation for the definition of acceleration, as follows:

vf = vo + at  

Replacing by the values already known for vo, vf and a, and solving for t, we get:

t = vf-vo /a = (29 m/s – 11.2 m/s) / 2.2 m/s = 8 sec

5 0
2 years ago
compressors, the gas is often cooled while being compressed to reduce the power consumed by the compressor. explain how cooling
ASHA 777 [7]

The amount of work done by steady flow devices varies with the particular gas volume. The kinetic energy of gas particles decreases during cooling.

When the gas is subjected to intermediate cooling during compression, the gas specific volume is reduced, which lowers the compressor's power consumption. Compression is less adiabatic and more isothermal because the compressed gas must be cooled between stages since compression produces heat. The system's thermodynamic cycle's cold sink temperature is lowered by cooling the compressor coils. By increasing the temperature difference between the heat source and the cold sink, this improves efficiency.

Learn more about thermodynamics here-

brainly.com/question/1368306

#SPJ4

8 0
1 year ago
If 5000 N of thrust is acting to the left, and 4300 N of drag is acting to the right, what is the magnitude and direction of the
Kipish [7]

Answer:

700 N acting to the left.

8 0
3 years ago
What are the chemical properties of metals
Grace [21]

Answer:

  • The density of metals are usually high
  • They are great conductors of heat
  • They are malleable and ductile

8 0
3 years ago
4. In the Hyatt Regency walkway case study, it is reported that Jack Gillum stamps the 42 shop drawings, including the revised S
mario62 [17]

Answer:

Responsibility

Explanation:

By stamping the drawings that he was looking over, Jack Gillum conveys the fact that he is accepting responsibility for this work. The purpose of Gillum's stamp is to explain that such work has been under engineering review, and that it has fulfilled all the requirements that he watches our for. By putting his stamp in this work, Gillum accepts responsibility in case an error or a discrepancy is found in the drawings.

3 0
2 years ago
Other questions:
  • Air is used as the working fluid in a simple ideal Brayton cycle that has a pressure ratio of 12, a compressor inlet temperature
    13·1 answer
  • 1. Why is outside air mixed with return air?​
    6·1 answer
  • The y-component of velocity for a certain 2-D flow field is given as u = 3xy + x2 . Determine the x-component of velocity if the
    12·1 answer
  • Why do we write proton ions first before electron ions? <br>​
    10·1 answer
  • 6. Question
    13·1 answer
  • Build a 32-bit accumulator circuit. The circuit features a control signal inc and enable input en. If en is 1 and inc is 1, the
    13·1 answer
  • 30 points have a good day
    11·1 answer
  • What is the difference between a natural and artificial diamond ​
    6·2 answers
  • Draw the six principal views of
    13·1 answer
  • Technician A says the compressor is the dividing line of the refrigeration system, low- to high-side. Technician B says the expa
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!