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]
3 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]3 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
True or False. A modern programming EXE provides a text editor, a file manager, a compiler, a linker and loader, and tools for d
Flauer [41]

Answer:

True

Explanation:

Mordern programming environments provide essential tools needed to build, test, debug, etc. examples are VSCode, Atom, Sublime text, etc.

7 0
3 years ago
Why might a photographer be interested in capturing the human element in his/her images? Describe your favorite example that dem
Andrej [43]
1) A photographer be interested in capturing the human element in his/her images because human beings can be as inspiring as everything that surrounds a photographer. Every artist has its own source of inspiration, and what if artist is the inspiration itself? Exploring human's beauty is the main part of developing your art (in this case photography) skills. 
2) I find hands, to be more exact,wrists, to be the most inspiring part of human body. There is a philosophical aspect in my opinion becuase people use their hands to create. Every person is unique, its hands are unique and these hands can create unique things.
7 0
3 years ago
I have no idea how to use the sep and end in Python can someone help me I have a test tomorrow
Nuetrik [128]

Answer:

The end parameter basically prints after all the output objects present in one output statement have been returned. the sep parameter differentiates between the objects.

Explanation:

Hope this helps

https://www.edureka.co/community/53505/difference-between-end-and-sep#:~:text=end%20and%20sep%20are%20optional,parameter%20differentiates%20between%20the%20objects.

4 0
3 years ago
A programmer is writing a program that is intended to be able to process large amounts of data. Which of the following considera
Dmitry [639]

Answer:

B. How many programming statements the program contains

Explanation:

If a program is intended to be able to process large amounts of data, then the ability of the program to process larger data sets is heavily affected by

  • execution time
  • size of memory the program requires
  • storage space the program requires as it runs.

The length of the statements the program contains does not much affect program performance.

8 0
3 years ago
Which of the following might be a job or task of an IT worker who manages networks?
Vladimir79 [104]
We need the options to be able to help.
7 0
4 years ago
Read 2 more answers
Other questions:
  • Elsa has collated information for a meeting using Excel. Due to certain developments, some of the data in her worksheet is now r
    6·1 answer
  • Select the correct answer.
    8·1 answer
  • What feature did we use to quickly apply the formatting shown in this image?
    9·1 answer
  • Do we have to use intersection?
    6·1 answer
  • What type of microscope requires a nonmetal sample to be prepared for viewing by coating it with a thin layer of a conductive ma
    9·2 answers
  • A user has connected a USB 3.0 device to a computer using a 3 ft (1m) USB 3.0 cable. However, instead of an expected data transf
    9·1 answer
  • Week 3 Discussion Requirements Modeling Requirements modeling is one of the earlier phases of software development where require
    7·2 answers
  • You can change the size of text using which block of code?
    11·1 answer
  • Rob used Track Changes to suggest changes in Jack's document. Jack agrees with some edits and disagrees with others. What should
    14·1 answer
  • What is 1 st genaration of computer ​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!