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 block of ice weighing 20 lb is taken from the freezer where it was stored at -15"F. How many Btu of heat will be required to c
Rus_ich [418]

Answer:

Heat required =7126.58 Btu.

Explanation:

Given that

Mass m=20 lb

We know that

1 lb =0.45 kg

So 20 lb=9 kg

m=9 kg

Ice at -15° F and we have to covert it at 200° F.

First ice will take sensible heat at up to 32 F then it will take latent heat at constant temperature and temperature will remain 32 F.After that it will convert in water and water will take sensible heat and reach at 200 F.

We know that

Specific heat for ice C_p=2.03\ KJ/kg.K

Latent heat for ice H=336 KJ/kg

Specific heat for ice C_p=4.187\ KJ/kg.K

We know that sensible heat given as

Q=mC_p\Delta T

Heat for -15F to 32 F:

Q=mC_p\Delta T

Q=9\times 2.03(32+15) KJ

Q=858.69 KJ

Heat for 32 Fto 200 F:

Q=mC_p\Delta T

Q=9\times 4.187(200-32) KJ

Q=6330.74 KJ

Total heat=858.69 + 336 +6330.74 KJ

Total heat=7525.43 KJ

We know that 1 KJ=0.947 Btu

So   7525.43 KJ=7126.58 Btu

So heat required to covert ice into water is 7126.58 Btu.

8 0
3 years ago
Which traditional subject is part of construction management or construction science syllabi?
N76 [4]

Answer:mathematics

Explanation:

4 0
3 years ago
Engineering Questions
valkas [14]
5 is the correct one to choose for this
6 0
3 years ago
Read 2 more answers
Does a food market have any rooms in particular? Also whats units?
makkiz [27]

Answer:

to be or not to be

Explanation:

Vivi is a drummer for a band. She burns 756756756 calories while drumming for 333 hours. She burns the same number of calories each hour.

8 0
3 years ago
Read 2 more answers
Teresa is emotionally volatile, particularly with friends and boyfriends. She is extremely dramatic about even the smallest disa
Ilia_Sergeevich [38]

Answer: Borderline personality Disorder.

Explanation: This is a type of mental disorder which could affects mood, behavior and relationships.

Its symptoms includes unstable emotions, sense of insecurity, worthlessness, and impulsivity.

This condition can not be cured, but treatments such as therapies, medication (in some cases) could help.

4 0
3 years ago
Other questions:
  • Water at 20oC, with a free-stream velocity of 1.5 m/s, flows over a circular pipe with diameter of 2.0 cm and surface temperatur
    13·1 answer
  • Passband to baseband conversion: Consider the following passband signal,
    14·1 answer
  • The cross-section of a rough, rectangular, concrete() channel measures . The channel slope is 0.02ft/ft. Using the Darcy-Weisbac
    8·1 answer
  • How to find magnitude of forces
    8·1 answer
  • Based on the following passage, why might the government use the U.S. Army Corps of Engineers to undertake hydroelectric power p
    14·1 answer
  • Question in image. Question from OSHA.
    11·2 answers
  • Water is pumped from a lake to a storage tank 18 m above at a rate of 70 L/s while consuming 20.4 kW of electric power. Disregar
    13·1 answer
  • Report of invertor to convert 12 volt to 220 volt.
    6·1 answer
  • You installed a new 40 gallon water heater with a 54,000 BTUh burner. The underground water temperature coming into the house is
    9·1 answer
  • How pine are processed ????
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!