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
In ipv4 addressing, an ip address whose first octet is in the range of 192–223 belongs to a class ____ network.
pishuonlain [190]

I guess the correct answer is class C network.

In IPv4 addressing, an IP address whose first octet is in the range of 192–223 belongs to a class C network.

4 0
3 years ago
For a typical program, the input is taken using _________ Command-line scanf Files All of the mentioned
vfiekz [6]

Answer:

D)All of above

Explanation:

This is the complete question

For a typical program, the input is taken using _________.

A)Files

B)Command-line

C)scanf

D)All of above

E)None of these

computer program could be regarded as a collection of instructions which can be executed using computer to carry out a specific task, and it is written by programmer ,Input in domain of computer could be explained as feeding some data into a program. This input could be in the form of a file as well as command line, with the help of programming set of built-in functions that will help in reading the given input as well as feeding it to the program base on requirement. The scanf do reads the input from the standard input stream( stdin and scans) which is been input based on provided format. It should be noted that For a typical program, the input is taken using Files, Command-line and scanf.

7 0
3 years ago
Define a function called strip_punctuation which takes one parameter, a string which represents a word, and removes characters c
DaniilM [7]

Answer:

punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@']

def strip_punctuation(strWord):

   for charPunct in punctuation_chars:

       strWord = strWord.replace(charPunct, "")

   return strWord

Explanation:

The function is defined with a single argument.

A for loop is ran to check each character of the the word.

If a punction mark is present as a character in the word, it is removed.

The same word is returned but without the punctuation marks.

8 0
3 years ago
In order for you to realize there has been a sensory change, it has to reach the __________ level of processing.
Kryger [21]

Answer: In order for you to realize there has been a sensory change, it has to reach the <u>perceptual</u> level of processing.

6 0
3 years ago
Search for and list an internet websites that defines plagiarism and discusses how to avoid it
Korvikt [17]
Here are the sites that defines plagiarism and how to avoid it:
1. http://www.plagiarism.org/article/what-is-plagiarism
2. https://en.wikipedia.org/wiki/Plagiarism
3. https://writingcenter.unc.edu/tips-and-tools/plagiarism/
4. http://gethelp.library.upenn.edu/guides/engineering/ee/plagiarize.html
5. http://www.aresearchguide.com/6plagiar.html
8 0
3 years ago
Other questions:
  • Declare a character variable letterStart. Write a statement to read a letter from the user into letterStart, followed by stateme
    10·1 answer
  • If the user enters 26 what is output? _____________
    15·1 answer
  • How do you pass graphic design. I have to make a project with a picture in the letter.
    6·1 answer
  • g Write a program using integers usernum and x as input, and output usernum divided by x four times. For example, if the input i
    14·1 answer
  • Which of the following is a scam in which a perpetrator sends an official looking e-mail that attempts to obtain a user’s person
    7·2 answers
  • The ____ option must be used when running a program in order to see the results of assert statements.
    7·1 answer
  • You can enter _____ in a cell to display tomorrow’s date
    12·1 answer
  • Abdul wants to create a header for a webpage and enters this line: Welcome to Abdul’s webpage! , but the title is smaller than w
    12·1 answer
  • HELP!!!!!
    15·1 answer
  • Can u guys report me as much as u can I’m trying to delete this account
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!