//add you starting comment block public class bubblebubblestarter //replace the word starter with your initials { public static void main (string[] args) { //task 1: create an input double array list named mylist with some values psystem. out. println("my list before sorting is: "); //task 2: print the original list //use println() to start and then replace with your printlist() method after task 4a is completed. p//task 3: call the bubblesort method for mylist p//task 4b: print the sorted list p} //task 4a: create a method header named printlist to accept a formal parameter of a double array //create a method body to step through each array element println each element p//printlist method header p//for loop p//println statement static void bubblesort(double[] list) { boolean changed = true; do { changed = false; for (int j = 0; j < list. length - 1; j++) if (list[j] > list[j+1]) { //swap list[j] with list[j+1] double temp = list[j]; list[j] = list[j + 1]; list[j + 1] = temp; changed = true; } } while (changed); } }
Get the answer
Category: statistics |
Author: Valko Tomer
Related Questions
//for drama// what are your thoughts on jonny depp's acting? why do y

//please answer// how are plants called epiphytes adapted to living i

//trigger warning: suicidal thoughts// i've been doubting life lately

Category
literature
//debugging exercises, chapter 9;java programming, joyce farrall, 8th edition import java. util. scanner; public class debugnine4 { enum planet {merc
business
/1 of the federal courts, which is the only one to have both original and appellate jurisdiction? o us district courts o us courts of appeal o us supr
ecology
/2872272020/materials/link/view/326 1738004 common assessment free response standard the world's largest salt flat 9 describe the era in which the u