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
The welding method that requires the operator to observe and only make corrections is
SVEN [57.7K]
Automatic manual semiautomatic
3 0
3 years ago
Read 2 more answers
Determine the velocity of the 13-kgkg block BB in 4 ss . Express your answer to three significant figures and include the approp
Anvisha [2.4K]

Answer:

The question has some details missing : The 35-kg block A is released from rest. Determine the velocity of the 13-kgkg block BB in 4 ss . Express your answer to three significant figures and include the appropriate units. Enter positive value if the velocity is upward and negative value if the velocity is downward.

Explanation:

The detailed steps and appropriate calculation is as shown in the attached file.

6 0
3 years ago
What is the average distance (in terms of R) between the mobile on the fringe of the serving cell and the second and third tier
kramer

Answer:

do you need all work shown for this?

4 0
3 years ago
Mr. Blue lives in a blue house, Mrs. Pink lives in a pink house and Mr. Red lives in a red house. Who lives in the White House?
Cerrena [4.2K]

Answer:

the president and mr.white my history teacher lol

6 0
3 years ago
Write an ALP to separate odd and even numbers from an array of N numbers; arrange odd
Marta_Voda [28]

Below is the program to separate odd and even numbers                                  

<u>Explanation</u>:

<u>L1:</u>

         mov ah,00

         mov al,[BX]

         mov dl,al

         div dh

         cmp ah,00

         je EVEN1

         mov [DI],dl

         add OddAdd,dl

         INC DI

         INC BX

         Loop L1

         jmp CAL

    <u>EVEN1:</u>

         mov [SI],dl

         add Even Add,dl

         INC SI

         INC BX

         Loop L1

    <u>CAL:   </u>  

         mov ax,0000

         mov bx,0000

         mov al,OddAdd

         mov bl,EvenAdd

         MOV  ax,4C00h

         int 21h

end

The above program separates odd and even numbers from the array using 8086 microprocessor. It has odd numbers in 2000h and even numbers in 3000h.

6 0
3 years ago
Other questions:
  • Carnot heat engine A operates between 20ºC and 520ºC. Carnot heat engine B operates between 20ºC and 820ºC. Which Carnot heat en
    5·1 answer
  • Are spheroidized steels considered as composite? If so, what is the dispersed phase a)- No b)- Yes, Chromium Carbides c)- Yes, I
    12·1 answer
  • A 150 MVA, 24 kV, 123% three-phase synchronous generator supplies a large network. The network voltage is 27 kV. The phase angle
    5·1 answer
  • Hot carbon dioxide exhaust gas at 1 atm is being cooled by flat plates. The gas at 220 °C flows in parallel over the upper and l
    15·1 answer
  • What did the discovery of the Cumberland Gap mean for exploration? PLEASE HELP ILL GIVE YOU BRAINLEIST!
    15·1 answer
  • A slab-milling operation is performed on a 0.7 m long, 30 mm-wide cast-iron block with a feed of 0.25 mm/tooth and depth of cut
    14·1 answer
  • Which of the following sentences uses the word malleable correctly?
    7·2 answers
  • When could you use the engineering design process in your own life?
    9·1 answer
  • 1. In order to minimize hazards, what should you do before starting a job
    10·2 answers
  • Is an example of an electrical device.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!