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
Your colleague received an E-mail from a bank that is requesting credit card and PIN number information. Which of the following
uysha [10]

Answer: A) Phishing

Explanation:

Phishing is type of attack in computer field that is processed to hack or steal the data of authorized user.The attacker acts as trusted party and then interacts with the authorized user through email or messages to gain  confidential information like pin code, credit card number, login details etc of that user.

  • According to the question, colleague is experiencing phishing as he has been requested for pin-code and credit-card number from a wrong source behaving as authorized bank.
  • Other options are incorrect because ransomware is attack that asks for ransom from authorized user for reviving their access. on system. Spoofing is falsifying as some other party to receive advantage.
  • Mail poisoning is inclusion of inappropriate details in email such as invalid email address etc.
  • Thus, the correct option is option(A).
0 0
3 years ago
C++ Question: what is in the blanks?
Igoryamba

You didn't specify what the program should output, so there are many possibilities that result in a working program. It *looks* like this was intended:

int x = 24;

int y;

y = x-12;

cout<<y<<endl;

and it will display 12.

8 0
3 years ago
Which tab should you choose to add a picture from a file to your presentation?
Tems11 [23]

C. Insert

Insert will let you inseet different things into your presentation.

6 0
3 years ago
.Draw the following sine wave in the time domain, showing amplitude and phase:
alexdok [17]

Answer with Explanation:

Part 1)

The given sine wave is as

y=3sin(2\pi t+\pi)

The graphical representation of the wave is shown in the attached figure:

Part 2)

For a general wave equation y(t)=Asin(\omega t+\phi )

'A' is defined as amplitude of the wave

(\omega t+\phi ) is defined as phase of the wave

Upon comparing with the given wave function we observe

1) Amplitude of the given wave is 3

2) Phase of the given wave (2\pi t+\phi )

7 0
3 years ago
What are ways to switch windows in Excel? Check all that apply. On the status bar, click the Windows button, and then click the
yulyashka [42]

On the status bar,Windows button, and then click the file name.click to display the Excel jump list, and then click the file name. On the View tab, in the Window group, click Switch Windows, and then click the file name. and also hint you can do alt tab  but alt first and then tab

8 0
3 years ago
Other questions:
  • Explain the difference between using the int type and the double type for numbers.
    11·1 answer
  • What type of survey can help a network administrator make decisions about bands, channels, and widths when installing new access
    9·1 answer
  • Special programs that facilitate communication between a device and the os are called
    12·1 answer
  • Define a class named ComparableSquare that extends Square (defined above) and implements Comparable. Implement the compareTo met
    7·1 answer
  • How does the use of the computer impact businesses
    13·1 answer
  • If one department chair—a professor—can chair only one department, and one department can have only one department chair. The en
    13·1 answer
  • Primary technology skills are skills that are necessary for success in online education
    9·2 answers
  • Which of these allows the programmer to put data inside a variable?
    5·1 answer
  • How is the architecture converted into software code? Elaborate the steps its passes through with help of examples / Diagram.
    15·1 answer
  • Which part of the computer is responsible for managing memory allocation for all applications
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!