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
For a short time a rocket travels up and to the left at a constant speed of v = 650 m/s along the parabolic path y=600−35x2m, wh
julia-pushkina [17]

Answer:

Detailed working is shown

Explanation:

The attached file shows a detailed step by step calculation..

4 0
3 years ago
Fully developed conditions are known to exist for water flowing through a 25-mm-diameter tube at 0.01 kg/s and 27 C. What is the
Irina18 [472]

Answer:

0.0406 m/s

Explanation:

Given:

Diameter of the tube, D = 25 mm = 0.025 m

cross-sectional area of the tube = (π/4)D² = (π/4)(0.025)² = 4.9 × 10⁻⁴ m²

Mass flow rate = 0.01 kg/s

Now,

the mass flow rate is given as:

mass flow rate = ρAV

where,

ρ is the density of the water = 1000 kg/m³

A is the area of cross-section of the pipe

V is the average velocity through the pipe

thus,

0.01 = 1000 × 4.9 × 10⁻⁴ × V

or

V = 0.0203 m/s

also,

Reynold's number, Re = \frac{VD}{\nu}

where,

ν is the kinematic viscosity of the water = 0.833 × 10⁻⁶ m²/s

thus,

Re = \frac{0.0203\times0.025}{0.833\times10^{-6}}

or

Re = 611.39 < 2000

thus,

the flow is laminar

hence,

the maximum velocity =  2 × average velocity = 2 × 0.0203 m/s

or

maximum velocity = 0.0406 m/s

5 0
3 years ago
Someone claims that in fully developed turbulent flow in a tube, the shear stress is a maximum at the tube surface. Is this clai
Alika [10]

Answer:

Yes this claim is correct.

Explanation:

The shear stress at any point is proportional to the velocity gradient at any that point. Since the fluid that is in contact with the pipe wall shall have zero velocity due to no flow boundary condition and if we move small distance away from the wall the velocity will have a non zero value thus a maximum gradient will exist at the surface of the pipe hence correspondingly the shear stresses will also be maximum.

5 0
3 years ago
Illustrate the crowbar protection for silicon controlled rectifier​
julsineya [31]

Answer:

The SCR over voltage crowbar or protection circuit is connected between the output of the power supply and ground. ... It also clamps the gate voltage at ground potential until the Zener turns on. The capacitor C1 is present to ensure that short spikes to not trigger the circuit.

4 0
3 years ago
With a very precise volumetric measuring device, the volume of a liquid sample is determined to be 6.321 L (liters). Three stude
zheka24 [161]

Answer:

See explanation

Explanation:

Solution:-

- Three students measure the volume of a liquid sample which is 6.321 L.

- Each student measured the liquid sample 4 times. The data is provided for each measurement taken by each student as follows:

                                                 Students

                      Trial          A            B               C

                         1            6.35        6.31          6.38

                        2            6.32        6.31          6.32

                        3            6.33        6.32         6.36

                        4            6.36        6.35         6.36

- We will define the two terms stated in the question " precision " and "accuracy"

- Precision refers to how close the values are to the sample mean. The dense cluster of data is termed to be more precise. We will use the knowledge of statistics and determine the sample standard deviation for each student.

- The mean measurement taken by each student would be as follows:

                       E ( A ) = \frac{6.35 +6.32+6.33+6.36}{4} \\\\E ( A ) = 6.34\\\\E ( B ) = \frac{6.31 +6.31+6.32+6.35}{4} \\\\E ( B ) = 6.3225\\\\E ( C ) = \frac{6.38 +6.32+6.36+6.36}{4} \\\\E ( C ) = 6.355\\

- The precision can be quantize in terms of variance or standard deviation of data. Therefore, we will calculate the variance of each data:

 

                        Var ( A ) = \frac{6.35^2+6.32^2+6.33^2+6.36^2}{4} - 6.34^2\\\\Var ( A ) = 0.00025\\\\Var ( B ) = \frac{6.31^2+6.31^2+6.32^2+6.35^2}{4} - 6.3225^2\\\\Var ( B ) = 0.00026875\\\\Var ( C ) = \frac{6.38^2+6.32^2+6.36^2+6.36^2}{4} - 6.355^2\\\\Var ( C ) = 0.000475\\

- We will rank each student sample data in term sof precision by using the values of variance. The smallest spread or variance corresponds to highest precision. So we have:

                   Var ( A )          <          Var ( B )        <    Var ( C )

                   most precise                                      Least precise

- Accuracy refers to how close the sample mean is to the actual data value. Where the actual volume of the liquid specimen was given to be 6.321 L. We will evaluate the percentage difference of sample values obtained by each student .

                       P ( A ) = \frac{6.34-6.321}{6.321}*100= 0.30058\\\\P ( B ) = \frac{6.3225-6.321}{6.321}*100= 0.02373\\\\P ( C ) = \frac{6.355-6.321}{6.321}*100= 0.53788\\

- Now we will rank the sample means values obtained by each student relative to the actual value of the volume of liquid specimen with the help of percentage difference calculated above. The least percentage difference corresponds to the highest accuracy as follows:

                   P ( B )         <       P ( A )         <      P ( C )

            most accurate                                least accurate

7 0
3 years ago
Other questions:
  • An 80-L vessel contains 4 kg of refrigerant-134a at a pressure of 160kPa. Determine (a) the temperature, (b) the quality, (c) th
    11·1 answer
  • Air enters a compressor operating at steady state with pressure of 90 kPa, at a temperature of 350 K, and a volumetric flow rate
    13·1 answer
  • The 10 foot wide circle quarter gate AB is articulated at A. Determine the contact force between the gate and the smooth surface
    10·1 answer
  • Automotive service P2 Wastewater Management and Handling Spins
    9·1 answer
  • 5.5 A scraper with a 275 hp diesel engine will be used to excavate and haul earth for a highway project. An evaluation of the jo
    10·1 answer
  • A converging - diverging frictionless nozzle is used to accelerate an airstream emanating from a large chamber. The nozzle has a
    15·2 answers
  • Water is the working fluid in an ideal Rankine cycle. Saturated vapor enters the turbine at 12 MPa, and the condenser pressure i
    8·2 answers
  • What should you use to turn the water off and open the door?
    7·2 answers
  • What organization which fire codes
    13·2 answers
  • Our aim is to calculate the efficiency of a gas turbine by assuming it operation can be modeled as a Carnot cycle. The kerosene
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!