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
Homes may be heated by pumping hot water through radiators. What mass of water (in g) will provide the same amount of heat when
Nitella [24]

Answer:

a mass of water required is mw= 1273.26 gr = 1.27376 Kg

Explanation:

Assuming that the steam also gives out latent heat, the heat provided should be same for cooling the hot water than cooling the steam and condense it completely:

Q = mw * cw * ΔTw = ms * cs * ΔTw + ms * L

where m = mass , c= specific heat , ΔT=temperature change, L = latent heat of condensation

therefore

mw = ( ms * cs * ΔTw + ms * L )/ (cw * ΔTw )

replacing values

mw = [182g * 2.078 J/g°C*(118°C-100°C) + 118 g * 2260 J/g ] /[4.187 J/g°C * (90.7°C-39.4°C)] = 1273.26 gr = 1.27376 Kg

3 0
3 years ago
Table 1(a) shows the marks obtained by 40 students in an examination
Arlecino [84]
I dont know the answer to this
5 0
3 years ago
10–25. The 45° strain rosette is mounted on the surface of a shell. The following readings are obtained for each gage: ε a = −20
vazorg [7]

Answer:

The answer is 380.32×10^-6

Refer below for the explanation.

Explanation:

Refer to the picture for brief explanation.

7 0
3 years ago
A resistance of 30 ohms is placed in a circuit with a 90 volt battery. What current flows in the circuit?
blagie [28]

Answer:

3A

Explanation:

Using Ohms law U=I×R solve for I by I=U/R

4 0
3 years ago
Urgent please help!<br> What are non-ferrous metal and ferrous metal?
m_a_m_a [10]
In metallurgy, non-ferrous metals are metals or alloys that do not contain iron in appreciable amounts. Generally more costly than ferrous metals, non-ferrous metals are used because of desirable properties such as low weight, higher conductivity, non-magnetic property or resistance to corrosion
8 0
2 years ago
Other questions:
  • A furnace wall consisting of 0.25 m of fire clay brick, 0.20 m of kaolin, and a 0.10‐m outer layer of masonry brick is exposed t
    8·1 answer
  • A torsion member has an elliptical cross section with major and minor dimensions of 50.0 mm and 30.0 mm, respectively. The yield
    10·1 answer
  • A water agency stated that waterlines cannot have water flowing faster than 8 ft/s. What is the minimum standard pipe diameter t
    12·1 answer
  • Significant figures are an indicator of accuracy. a) True b) False
    8·1 answer
  • Which of the following units of measurement is denoted by a single apostrophe mark (')?
    6·1 answer
  • Match the terms with the correct definitions.
    14·1 answer
  • Three spheres are subjected to a hydraulic stress. The pressure on spheres 1 and 2 is the same, and they are made of the same ma
    8·1 answer
  • How are sedimentary - gravity flows different from fluid - gravity flows
    6·1 answer
  • Please help me on this it’s due now
    14·1 answer
  • The most important reason to wear your seat belt is to protect you from:
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!