Menu

[solved]-Write Java Program Single Dimension Array Holds 10 Integer Numbers Identify Maximum Value Q39041372

Write a Java program with a single-dimension array that holds 10integer numbers and identify the maximum value of the 10 numbers.Next sort the array using a bubble sort and display the arraybefore and after sorting.

Create an algorithm (either flowchart or pseudocode) that youwill use to write the program.

1. Generate 10 random integer numbers between 1 and 100, andplace each random number in a different element of asingle-dimension array starting with the first numbergenerated.

2. Locate the largest of the 10 numbers and display itsvalue.

3. Display the array’s contents in the order the numbers areinitially inserted. This is called an unsorted list.

4. Using the bubble sort, now sort the array from smallestinteger to the largest. The bubble sort must be in its own method;it cannot be in the main method. use this code for the bubblesort.

public static void bubbleSort(int list) int temp; for (int i list.length-1; i> 0; i-) for (int j= 0;ji; { if (list listi 1 te

add comments to the code to explain the various steps

below is an example of what the program output should looklike.

<terminated> C7 Project (2) Java Application] CProgram FilesJavaljre1.8.0.131binjavaw.exe (Mar 26, 2019, 11:24:20 AM) The lar

public static void bubbleSort(int list) int temp; for (int i list.length-1; i> 0; i-) for (int j= 0;ji; { if (list listi 1 temp list) listi listli 1) listli 1temp; <terminated> C7 Project (2) Java Application] CProgram FilesJavaljre1.8.0.131binjavaw.exe (Mar 26, 2019, 11:24:20 AM) The largest value is 10e The unsorted list is: 64 24 25 48 71 1ee 5 81 3 The sorted list is: 3 5 24 48 64 71 81 100 un SAMPIE Show transcribed image text public static void bubbleSort(int list) int temp; for (int i list.length-1; i> 0; i-) for (int j= 0;ji; { if (list listi 1 temp list) listi listli 1) listli 1temp;
C7 Project (2) Java Application] CProgram FilesJavaljre1.8.0.131binjavaw.exe (Mar 26, 2019, 11:24:20 AM) The largest value is 10e The unsorted list is: 64 24 25 48 71 1ee 5 81 3 The sorted list is: 3 5 24 48 64 71 81 100 un SAMPIE

Expert Answer


Answer to Write a Java program with a single-dimension array that holds 10 integer numbers and identify the maximum value of the 1… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *