Answer.
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
podryga [215]
1 year ago
10

//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); } }
Computers and Technology
1 answer:
spin [16.1K]1 year ago
8 0

Answer:

See explaination

Explanation:

import java.util.Scanner;

public class BubbleBubbleStarter {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

double arr[] = new double[10];

System.out.println("Enter 10 GPA values: ");

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

arr[i] = sc.nextDouble();

sc.close();

System.out.println("My list before sorting is: ");

printlist(arr);

bubbleSort(arr);

System.out.println("My list after sorting is: ");

printlist(arr);

}

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]) {

double temp = list[j];

list[j] = list[j + 1];

list[j + 1] = temp;

changed = true;

}

}

} while (changed);

}

static void printlist(double list[]) {

for (int j = 0; j < list.length; j++) {

System.out.println(list[j]);

}

}

}

You might be interested in
You manage Windows desktops for you organization. You recently updated all you workstations to Windows 7. Your organization reli
trapecia [35]

Answer:

You should try to run the application in compatibility mode

Explanation:

To run the computer in compatibility mode right-click the application and press propertys then press compatibility mode.

8 0
11 months ago
1.is there a digital way to mark your favorite website in the internet?Expound your thoughts.
charle [14.2K]

Yes, there is a way to mark your favourite website on the internet by adding it to bookmark

Explanation:

No, I didn't find it difficult to create a bookmark.

It was easy you just have to click on the bookmark button

5 0
9 months ago
A new​ technology, product, or service that eventually surpasses the existing dominant​ technology, product, or service in the m
babymother [125]

Answer:

Disruptive Innovation

Explanation:

Based on the information provided within the question it can be said that the term that is being mentioned is called a Disruptive Innovation. This term refers to a new innovative technology that is introduced into a market and whose effect of that action significantly changes the way the market is used to functioning.

7 0
1 year ago
When would you use the AutoFit to Contents option?
k0ka [10]

Answer: when there is lots of data and we want to fit in some folder.

Explanation:

4 0
11 months ago
Given two variables matric_age and grad_age, write a statement that makes the associated value of grad_age 4 more than that of m
bearhunter [10]

Answer:

grad_age=matric_age+4

Explanation:

As mention in the question their are two variable matric_age and grad_age respectively .The grad_age variable store the value of 4 more than that of matric_age i.e (matric_age+4) means that it store the value 4 plus matric_age Suppose a matric_age is initialized with 4 then value of grad_age=4+4=8.

8 0
1 year ago
Other questions:
  • In cell g6, enter a formula that calculates the discount rate for the off-peak rental price per day. for example, using the peak
    15·1 answer
  • How many times go you need to click the format painter button to apply copied formats to multiple paragraphs one right after the
    5·2 answers
  • What phone had emojis first?
    13·2 answers
  • Match the instruments with their uses.
    15·2 answers
  • Which of the following are agricultural industry clusters? Human population systems, computer technoloy biotechnology or food pr
    10·1 answer
  • Três exemplos de inteligência artificial que estao em contato direto com os usuarios
    9·1 answer
  • Write an expression that will cause "greater or equal to -10" to print if the value of userNum is greater than or equal to -10.
    14·1 answer
  • When was the federal commission act put into effect?????
    13·1 answer
  • Por que es importante el audlamiento social en una pandemia por virus biológico
    7·1 answer
  • In your own words describe the benefits of creating functions in your code
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!