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
ololo11 [35]
3 years ago
10

12.2 Sort an array in ascending order Write a program that gets a list of integers from input, and outputs the integers in ascen

ding order (lowest to highest). The first integer indicates how many numbers are in the list. Assume that the list will always contain less than 20 integers. Ex: If the input is:
Computers and Technology
1 answer:
notsponge [240]3 years ago
7 0

Answer:

Explanation:

The following code is written in Java, it asks the user for the number of inputs that will be made and then the inputs. These inputs are placed into an array. Then the array is sorted and printed out to the terminal.

public static void sortArrayList() {

           ArrayList<Integer> sortedList = new ArrayList();

           Scanner input = new Scanner(System.in);

           System.out.println("Enter number of digits in Array");

           int numberOfInputs = input.nextInt();

           for (int i = 0; i < numberOfInputs; i++) {

                   System.out.println("Enter a number");

                   sortedList.add(input.nextInt());

           }

           int n = sortedList.size();

           for (int i = 0; i < n; i++)

               for (int j = 0; j < n-i-1; j++)

                   if (sortedList.get(j) > sortedList.get(j + 1))

                   {

                       // swap arr[j+1] and arr[j]

                       int temp = sortedList.get(j);

                       sortedList.set(j, sortedList.get(j + 1));

                       sortedList.set(j + 1, temp);

                   }

           for (int x : sortedList) {

               System.out.println(x);

           }

       }

You might be interested in
What is an example of a hard skill?
Serjik [45]
3 would be self management
4 0
3 years ago
Read 2 more answers
A(n) _____ chart is drawn on the same worksheet as the data.
Harrizon [31]
The answer is An embedded chart
6 0
3 years ago
Hich chip contains the information necessary to start the computer system?
Sindrei [870]
The BIOS contains the information.
7 0
3 years ago
A) How can jitter be reduced on a user’s PC if there is jitter in incoming packets?
ELEN [110]

Answer:

a.) Incoming packets can be placed in the buffer and played back without the jitter.

b.) Buffering would increase the latency because there would be a delay in time when the packets enter the buffer and the time is released.

Explanation:

Jitter is referred technically as a packet delay variations.

It is variation in the periodicity of periodic events or a signal from target or the true frequency.

6 0
3 years ago
What's your opinion on sentrent (it's a Pokemon)​
Vadim26 [7]

Answer:

Hes really nice

TSUNAMI SUSHI HAS A TSUNAMI OF ADMIN ABUSE!! TSUNAMI SUSHI HAS A TSUNAMI OF ADMIN ABUSE!! TSUNAMI SUSHI HAS A TSUNAMI OF ADMIN ABUSE!! TSUNAMI SUSHI HAS A TSUNAMI OF ADMIN ABUS!Chicken wing

Chicken wing

Hot dog and baloney

Chicken and macaroni

Chillin with my homies

Chicken wings

Chicken wings

4 0
2 years ago
Read 2 more answers
Other questions:
  • AMSCO networks plans to conduct a poll of viewers during the SuperBowl. They will conduct analysis to determine which area of th
    6·2 answers
  • Write a program that prompts the user to enter an equation in the form of 10 5, or 10-5, or 1*5, or 13/4, or 13%4. The program s
    6·1 answer
  • What is the name for a partition that has been formatted and assigned a drive letter?
    8·1 answer
  • When he takes a picture, Simon freezes an action without blurring it, to show movement. Which type of photographer is he?
    9·2 answers
  • Anybody know this question??
    8·1 answer
  • Which of the following is true of binary files?
    6·2 answers
  • PLEASE PLEASE PLEASE PLEASE help me Im completly lost will give brainliest and 50 points
    8·2 answers
  • PLEASE ANSWER AND HURRY I'LL MARK YOU BRAINLIEST!!<br><br><br>​
    9·1 answer
  • My computer is being weird, Everytime I begin to type something on here it keeps adding a letter to the beginning of my sentence
    8·1 answer
  • Retype the below code. Fix the indentation as necessary to make the program work.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!