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
What is an example of a class 2 lever?
9966 [12]

Answer:

A wheelbarrow, a bottle opener, and an oar are examples of second class levers

6 0
2 years ago
Read 2 more answers
A long corridor has a single light bulb and two doors with light switch at each door.
Tpy6a [65]

Answer:

  Light = A xor B

Explanation:

If switches A and B produce True or False, then Light will be True for ...

  Light = A xor B

8 0
3 years ago
The velocity profile for a thin film of a Newtonian fluid that is confined between the plate and a fixed surface is defined by u
zimovet [89]

Answer:

F = 0.0022N

Explanation:

Given:

Surface area (A) = 4,000mm² = 0.004m²

Viscosity = µ = 0.55 N.s/m²

u = (5y-0.5y²) mm/s

Assume y = 4

Computation:

F/A = µ(du/dy)

F = µA(du/dy)

F = µA[(d/dy)(5y-0.5y²)]

F = (0.55)(0.004)[(5-1(4))]

F = 0.0022N

8 0
3 years ago
What should you release to re-establish vehicle control and tire traction?
MrMuchimi

Answer: The accelerator and the brakes.

6 0
2 years ago
Suppose within your web browser you click on a link to obtain a web page. The IP address for the associated URL is already cache
aleksandrvk [35]

Answer:

All the detailed steps are mentioned in pictures.

Explanation:

See attached pictures.

8 0
3 years ago
Other questions:
  • Question Set 22.1 Using the count method, find the number of occurrences of the character 's' in the string 'mississippi'.2.2 In
    10·1 answer
  • A student is using a 12.9 ft ramp to raise an object 6 ft above the ground.
    5·1 answer
  • A piston-cylinder device contains 0.8 kg of steam at 300°C and 1 MPa. Steam is cooled at constant pressure until one-half of the
    9·1 answer
  • 6. PVC boxes are primarily used in new construction because it is simple to
    11·1 answer
  • What is the advantage of Sensabot over human inspectors?
    12·1 answer
  • What did the ancient Greeks use simple machines for?
    15·2 answers
  • Write the following statements as Prolog clauses, in the order given: If it is raining or snowing, then there is precipitation.
    15·1 answer
  • A 40kg steel casting (Cp=0.5kJkg-1K-1) at a temperature of 4500C is quenched in 150kg of oil (Cp=2.5kJkg-1K-1) at 250C. If there
    13·1 answer
  • The nuclear reactions resulting from thermal neutron absorption in boron and cadmium are 10B5 + 1 n0 ï  7Li3 + 4He2 113Cd48 + 1
    9·1 answer
  • Merchandise without an expiration date like electronics, tools and home goods typically have a longer
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!