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
podryga [215]
3 years 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]3 years 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
My computer just fried anybody know why it did that?
pochemuha
You was probably was too MLG and it blew its top my boy !
7 0
3 years ago
Read 2 more answers
Write an interactive program to calculate the volume and surface area of a three-dimensional object
Sveta_85 [38]

Answer in Python:

<em># Define program constants</em>

PI = 3.14

<em># Welcome the user to our program</em>

print("### Welcome to the Sphere Volume Calculator")

<em># Ask for the Radius (r) input and store it as a float</em>

radius = float(input("Type the Radius of your sphere in meters: "))

<em># Calculate the volume</em>

volume = 4 / 3 * PI * radius ** 3

<em># Print the result</em>

print("Your sphere volume is:", volume, "m³")

References:

  • https://www.w3schools.com/python/python_variables.asp
  • https://www.w3schools.com/python/python_casting.asp
  • https://www.w3schools.com/python/python_user_input.asp
  • https://www.w3schools.com/python/python_operators.asp
  • https://www.w3schools.com/python/ref_func_print.asp
5 0
3 years ago
How to get points on Brainly?<br> List at least two ways if you can.
GarryVolchara [31]

Answer:

1. Answering questions

2. Logging in everyday

Explanation:

By answering questions, you will earn points. By logging in everyday, I think they give you points as well. Good luck, and hope this helped! :-)

6 0
3 years ago
Read 2 more answers
____ data exist in a format that does not lend itself to processing that yields information.
Nastasia [14]
The word that goes in the blank is "unstructured."
4 0
4 years ago
What are examples of object types that can be viewed in the Navigation pane? Check all that :
TiliK225 [7]

Answer:

2.) Forms

4.) Queries

6.) Tables

Explanation:

8 0
3 years ago
Other questions:
  • What is the difference between images and pictures
    6·1 answer
  • A computer professional who has access to sensitive information shares this information with a third party. Which professional c
    9·2 answers
  • Which letters appear in the home row on a keyboard?
    14·2 answers
  • Help?!<br> Does anyone know how to use Adobe SoundBooth?
    14·2 answers
  • I'm a number less then 40000.all my digits are multiples of 3.my first third a d fifth digits are the same both of my thousands
    10·1 answer
  • You will be administratively suspended if you have a breath or blood alcohol level of.... or above or refuse to submit to a chem
    12·1 answer
  • The automatic number of worksheets that appear when you open a blank Excel workbook is ? 1.One 2.Three 3.Six 4.Ten
    8·1 answer
  • python Create a new qualitative variable, called Elite, by binning the Top10perc variable. We are going to divide universities i
    6·1 answer
  • ¿Que es un problema para ti?
    7·1 answer
  • Which factors have increased the need for the latest cybersecurity technologies?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!