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 wastewater is to be disinfected using ultraviolet (UV) light. Batch experiments find that the bacterial concentration decays u
Ksivusya [100]

Answer:

k = 0.1118 per min

Explanation:

Assume;

Initial number of bacteria = N0

Number of bacteria IN 'T' time = Nt

So,

Nt=N0e^{-kt}\\\\in\ 6.2 min\\\\\\frac{N0}{2}= N0e^{-k(6.2)}\\\\ln\frac{1}{2} = -k[6.2]

k = 0.1118 per min

7 0
3 years ago
Does anyone know obamas last name???? please help its for a friend I swear!!!111!!11!
ANTONII [103]

Answer:

Explanation:

Barack Hussein Obama

6 0
3 years ago
What is the subtotal for the building materials in the bill? The subtotal should be the cost of the materials only. Don't add ta
Alexxx [7]

Answer:

Cost before adding taxes and incorporating variations

Explanation:

The sub-totals are basically sum of the cost from individual pages before including value added tax or any other tax depending with the state regulations. At this stage, contingencies and variation of prices are not considered. Therefore, the sub-total for building materials only include the materials on site or materials used as per the bill of quantities and certified by the engineer.

3 0
4 years ago
What is the difference between white and yellow line?
Savatey [412]

Answer:

The question doesnt make any sense. Like what are the lines used for.

Explanation:

5 0
3 years ago
Read 2 more answers
Explain how smart materials can be used by manufacturers to improve health and safety for children's products and goods.​
Ierofanga [76]

...simplify devices, reducing weight and the chance of failure.

6 0
2 years ago
Other questions:
  • Does a thicker core make an electromagnet stronger?
    13·1 answer
  • Please read
    6·1 answer
  • In a steam power plant, the temperature of the burning fuel is 1100 °C, and cooling water is available at 15 °C. Steam leaving t
    15·1 answer
  • A socket can be driven using any of the following except for (A) a socket ratchet
    14·1 answer
  • N2 flows through an insulated horizontal tube at steady state. With an inlet temperature of 150°C and a velocity change from 2 m
    11·1 answer
  • Design a solid steel shaft to transmit 14 hp at a speed of 2400rpm f the allowable shearing stress is given as 3.5 ksi.
    10·1 answer
  • How Much do Biomedical Engineers Earn?
    10·2 answers
  • Which of the following identifies one factor that causes conventional tillage to actually be good for the environment?
    7·1 answer
  • An automotive piston's connecting rod is 8 inches long. What is the approximate length of this connecting rod in millimeters?
    7·1 answer
  • MANUFACTURING QUESTION PLEASE HELP​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!