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 buyer can purchase 70 screwdrivers ten 4-inch length twelve 6 inch length twenty 8-inch length are needed. how many heavy 24-i
jasenka [17]

Answer:

28 , 24-inch screwdrivers

Explanation:

The total number of screwdrivers that can be purchased is = 70

4 - inch length screwdrivers = 10

6- inch length screwdrivers = 12

8- inch length screwdrivers = 20

Total = 20 +12 +10 = 42

Remaining = 70-42 = 28

So, heavy 24-inch screwdrivers = 28

3 0
2 years ago
Each cout statement has a syntax error. Type the first cout statement, and press Run to observe the error message. Fix the error
saul85 [17]

Answer:

1. cout << "Num: " << songNum << endl;

2. cout << songNum << endl;

3. cout << songNum <<" songs" << endl;

Explanation:

//Full Code

#include <iostream>

using namespace std;

int main ()

{

int songNum;

songNum = 5;

cout << "Num: " << songNum << endl;

cout << songNum << endl;

cout << songNum <<" songs" << endl;

return 0;

}

1. The error in the first cout statement is that variable songnum is not declared.

C++ is a case sensitive programme language; it treats upper case and lower case characters differently.

Variable songNum was declared; not songnum.

2. Cout us used to print a Variable that has already been declared.

The error arises in int songNum in the second cout statement.

3. When printing more than one variables or values, they must be separated with <<

4 0
3 years ago
Gas is kept in a 0.1 m diameter cylinder under the weight of a 100 kg piston that is held down by a spring with a stiffness k =
Artyom0805 [142]

Answer:

The spring is compressed by 0.275 meters.

Explanation:

For equilibrium of the gas and the piston the pressure exerted by the gas on the piston should be equal to the sum of  weight of the piston and the force the spring exerts on the piston

Mathematically we can write

Force_{pressure}=Force_{spring}+Weight_{piston}

we know that

Force_{pressure}=Pressure\times Area=300\times 10^{3}\times \frac{\pi \times 0.1^2}{4}=750\pi Newtons

Weight_{piston}=mass\times g=100\times 9.81=981Newtons

Now the force exerted by an spring compressed by a distance 'x' is given by Force_{spring}=k\cdot x=5\times 10^{3}\times x

Using the above quatities in the above relation we get

5\times 10^{3}\times x+981=750\pi \\\\\therefore x=\frac{750\pi -981}{5\times 10^{3}}=0.275meters

5 0
3 years ago
Steam enters a two-stage adiabatic turbine at 8 MPa and 5008C. It expands in the first stage to a state of 2 MPa and 3508C. Stea
Nataly [62]

Answer:

1) The exergy of destruction is approximately 456.93 kW

2) The reversible power output is approximately 5456.93 kW

Explanation:

1) The given parameters are;

P₁ = 8 MPa

T₁ = 500°C

From which we have;

s₁ = 6.727 kJ/(kg·K)

h₁ = 3399 kJ/kg

P₂ = 2 MPa

T₂ = 350°C

From which we have;

s₂ = 6.958 kJ/(kg·K)

h₂ = 3138 kJ/kg

P₃ = 2 MPa

T₃ = 500°C

From which we have;

s₃ = 7.434 kJ/(kg·K)

h₃ = 3468 kJ/kg

P₄ = 30 KPa

T₄ = 69.09 C (saturation temperature)

From which we have;

h₄ = h_{f4} + x₄×h_{fg} = 289.229 + 0.97*2335.32 = 2554.49 kJ/kg

s₄ =  s_{f4} + x₄×s_{fg} = 0.94394 + 0.97*6.8235 ≈ 7.563 kJ/(kg·K)

The exergy of destruction, \dot X_{dest}, is given as follows;

\dot X_{dest} = T₀ × \dot S_{gen} = T₀ × \dot m × (s₄ + s₂ - s₁ - s₃)

\dot X_{dest} = T₀ × \dot W×(s₄ + s₂ - s₁ - s₃)/(h₁ + h₃ - h₂ - h₄)

∴ \dot X_{dest} = 298.15 × 5000 × (7.563 + 6.958 - 6.727 - 7.434)/(3399 + 3468 - 3138  - 2554.49) ≈ 456.93 kW

The exergy of destruction ≈ 456.93 kW

2) The reversible power output, \dot W_{rev} = \dot W_{} + \dot X_{dest} ≈ 5000 + 456.93 kW = 5456.93 kW

The reversible power output ≈ 5456.93 kW.

6 0
3 years ago
Getting the bottom of your feet burned when walking on hot sand is due to what form of energy transmission? group of answer choi
Scilla [17]

Getting the bottom of your feet burned when walking on hot sand is due to a form of energy transmission known as conduction.

<h3>The types of energy transmission.</h3>

In Science, there are three (3) main types of energy transmission and these include the following:

  • Convection
  • Radiation
  • Conduction

In this scenario, we can infer and logically conclude that burning the bottom of your feet when walking on hot sand is primarily due to a form of energy transmission known as conduction because it involves the transfer of thermal energy (heat) due to the movement of particles.

Read more on heat conduction here: brainly.com/question/12072129

#SPJ12

6 0
1 year ago
Other questions:
  • The water requirement for Class H cement is 38% (i.e.,water (%) by weight of cement),whereas the water requirement for barite is
    7·1 answer
  • A stem and leaf display
    12·1 answer
  • Calculate the molar heat capacity of a monatomic non-metallic solid at 500K which is characterized by an Einstein temperature of
    8·1 answer
  • This manometer is used to measure the difference in water level between the two tanks.
    10·1 answer
  • A long rod of 60-mm diameter and thermophysical properties rho=8000 kg/m^3, c=500J/kgK, and k=50 W/mK is initally at a uniform t
    8·1 answer
  • A Wii remote flung from a hand through a TV, with a kinetic energy of 1.44J and a mass of 4.5kg. Whats the velocity?
    6·1 answer
  • If my current directory is ‘AR’ write the path for my current directory
    5·1 answer
  • ILL GIVE BRAINLIEST!!!
    11·1 answer
  • Solve the inequality. Then graph your solution.<br> -9v – 10 &lt; 7y +6
    14·1 answer
  • Contrast moral and immoral creativity and innovation<br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!