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
netineya [11]
2 years ago
11

Write a void function SelectionSortDescendTrace() that takes an integer array and sorts the array into descending order. The fun

ction should use nested loops and output the array after each iteration of the outer loop, thus outputting the array N-1 times (where N is the size). Complete main() to read in a list of up to 10 positive integers (ending in -1) and then call the SelectionSortDescendTrace() function. If the input is:
Computers and Technology
1 answer:
vampirchik [111]2 years ago
7 0

Answer:

Explanation:

The following program is written in Java. The main method asks the user to enter 10 different integer values. These values are saved to an integer array and passed to the SelectionSortDescendTrace() method. This method sorts the array in descending order while printing the entire array after every outer loop cycle. The program was tested and the output can be seen in the attached image below.

import java.util.*;

class Brainly {

   // Main Method

   public static void main(String[] args)

   {

       Scanner in = new Scanner(System.in);

       int[] myArr = new int[10];

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

           System.out.print("Enter an integer: ");

           myArr[i] = in.nextInt();

           System.out.print('\n');

       }

       SelectionSortDescendTrace(myArr);

   }

   public static void SelectionSortDescendTrace(int[] myArr) {

       int temp;

       for (int i = 0; i < myArr.length; i++)

       {

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

           {

               if (j != myArr.length - 1)

               {

                   if (myArr[j] < myArr[j + 1])

                   {

                       temp = myArr[j];

                       myArr[j] = myArr[j + 1];

                       myArr[j + 1] = temp;

                   }

               }

           }

           System.out.println(Arrays.toString(myArr));

       }

   }

}

You might be interested in
What was software for modems that connected through phone lines called?
balandron [24]

Answer:

Best Regards to all of the people who have met you in the class

4 0
3 years ago
A and B have same output or not? A B x=0 x=0 do do x&lt;3 x=x+1 x=x+1 print x print x while x&lt;3 while
katen-ka-za [31]

Answer:

A and B have different output:

A output will be 1

B output will be 123

Explanation:

A

X = 0

do x < 3

x = x+1

print x

while

B

X = 0

do x = x+ 1

print x

while x < 3

For statement A the condition statement which suppose to be after "while" is not set therefore the value of x will be printed.

For statement B the condition statement is set "x < 3" in front of "while" thereby result in iteration until the condition is false.

Statement A output will be 1

Statement B output will be 123

6 0
3 years ago
Sarah is starting her first job at the local ice cream shop. what can Sarah do to make a good impression on her first day of wor
nikdorinn [45]
Dress appropriate and have a good attitude
7 0
2 years ago
Read 2 more answers
ZeroIt is a function that takes one argument and returns no value. The argument is a pointer to int. The function stores the val
Sedbober [7]

Answer:

zeroIt(&x);

Explanation:

The statement that sets the value stored in x to zero by invoking the function zerolt is given below

zeroIt(&x);

The zeroIt function is also given below for better understanding.

void zeroIt(int *x) {

   *x = 0;

}

As seen, the function takes an argument with integer variable type, which is a pointer, denoted by the asterisk symbol (*x).

The ampersan sign (&x) is used to access the variable whose value can then be stored.

7 0
3 years ago
The first graphical browser application for using the web was netscape. <br> a. True <br> b. False
Mamont248 [21]
Hello <span>Jcece6710 
</span>

Question: <span>The first graphical browser application for using the web was netscape. True or False


Answer: True

Hope that helps
-Chris</span>
5 0
3 years ago
Other questions:
  • How do u change the level of education on Brainly. cuz i just finished elementry
    9·2 answers
  • Use your own words to describe how IT/IS can support major functional areas in the business. Discuss at least two of these areas
    14·1 answer
  • ________ hackers break into systems for non-malicious reasons such as to test system security vulnerabilities. black-hat gray-ha
    10·1 answer
  • A computer that no longer works after having minor repair works done to it may have been damaged by
    8·2 answers
  • A software process describes the interrelationship among the phases by expressing their order and frequency, but does not define
    14·1 answer
  • To give your app users the ability to open your app directly from other apps by clicking a link, you should use:.
    11·1 answer
  • A chemical mixture that is burned to produce thrust. (Jet engine homework)
    14·2 answers
  • Research and recommend the most appropriate VPN technology. The most likely solution is either an Internet Protocol Security (IP
    5·1 answer
  • Tasks you can perform online include which of the following?
    13·1 answer
  • What is the purpose of application software policies? Check all that apply.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!