Write a void method selectionSortDescendTrace() that takes an integer array, and sorts the array into descending order. The method 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() method. If the input is: 20 10 30 40 -1 then the output is: 40 10 30 20 40 30 10 20 40 30 20 10

Question

Write a void method selectionSortDescendTrace() that takes an integer array, and sorts the array into descending order. The method 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() method.

If the input is:

20 10 30 40 -1

then the output is:

40 10 30 20

40 30 10 20

40 30 20 10

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Engineering

Programing

Related Computer Engineering Q&A

Find answers to questions asked by students like you.

Q: Explain the conçept of "Pointers", provide an example?

A: Pointers: It is a variable which stores the address of another variable. Unlike other variables whi...

Q: Create a program in c++ that will count the total amount that will spend in riding a bus.  Given: 8 ...

A: #include <iostream>using namespace std;int main(){    int senior,regular,money;    int fare=0;...

Q: how to get distance measurement from camera formula?

A: Camera Distance : In order to determine the distance from our camera to a known object or marker, we...

Q: Using java need help creating a program for my homework assignment. Need to create a craps game that...

A: Define class Main Define main method Define variable roll with int as data type Create sum of 2 roll...

Q: Can a static method be called a non-static method?

A: Static method: A static method is property of the class and it is defined with "static" keyword. I...

Q: What are the opportunities and constraints of using BPMN in today’s organisation setup.

A: The opportunities and constraints of using BPMN in an organization setup are : Associations which ar...

Q: c++

A: Specifiers can be of access specifier or type specifier Access Specifiers are those which defines th...

Q: Write a c++ program that takes N as a positive integer input and prints alternate digits on a differ...

A: Program: //included header file#include<iostream>//included namespaceusing namespace std;//mai...

Q: Assume you are working as a network professional in a company. The company requires you to create so...

A: Network 192.168.10.0/26 is the given IP address It belongs to Class C IP address a) Subnet mask is 2...

Q: Compare the data rates for Standard Ethernet, Fast Ethernet, Gigabit Ethernet, and Ten-Gigabit Ether...

A: The data rate is the date that was transmitted per given unit time interval and generally these data...

Q: Write a C++ program that displays a menu to the user to choose among four arithmetic operations, get...

A: # include <iostream> using namespace std; //Function declaration void add(int number1, int num...

Q: Many large organizations have had their database systems hacked and customer data stolen. Discuss ho...

A: Database : It is storage that can store the data which can be manipulated or accessed. Security of d...

Q: Help their can POSSIBLY be more than one correct answer

A: Actually, given question is examples of open method roots of afunction

Q: It is said that series is size Immutable but still if we want to add a new data to it how can that b...

A: Series is a function of the pandas library in python.  it is a 1 Dimensional labeled array that can ...

Q: Hi I need help to understand what to do in this questions I have imported the file using mongodimpor...

A: As you  have already imported the file now..A query can be used for the collection using mongodb she...

Q: -------------HW1_P1_INCOMPLETE.JAVA,,,,,,,,,,,,,,,,,,,,,,,,,, public class Hw1_part1 { public static...

A: Below is the required java program: - Program: - //Import the packages import java.util.Arrays; //De...

Q: Write a class Point with instance variables as: xCoordinate(int) and yCoordinate(int). Write public ...

A: public class Main{ public static void main(String[] args) {          //create Circle instace and tes...

Q: How many length twenty strings of a’s, b’s, and c’s haveten a’s, six b’s, and four c’s?

A: Solution: in which 20 is used for total string length.  10 for a's and   6 for b's , 4 for c's

Q: 2. C has three looping structures. For each looping structure, check the characteristics that can ap...

A: A Loop performs the sequence of statements a number of times until the condition is false. The loop ...

Q: Q1] A 700 Mbyte CD is used to store PCM voice data. Suppose that a CT voice signal is sampledat 10 k...

A: Actually, 1 byte = 8 bits.

Q: (c) Match the following to one or more layers of the OSI model:a. Format and code conversion service...

A: a) Format and code conversion services -  Presentation Layer. b) Establishes, manages and terminates...

Q: True or false  An AVL requires that the heights of two subtrees for a given node differ by no mo...

A: AVL Tree: It is invented by GM Adelson - Velsky and EM Landis in 1962. It is a height-balanced BST ...

Q: Write an algorithm to input a number. Find its square if the entered number is multiple of 10. If en...

A: The algorithm is given by: Start Read the number as N check if (N%10==0) if true do step 4 else go ...

Q: c++

A: In the solution of given problem, we use call by reference method to pass struct variable into read(...

Q: Describe how you would deal with relation type M:N showing an example in a practical

A: MANY-TO-MANY (M: N) RELATIONSHIP: Many-to-Many relationship refers to the relationship between two e...

Q: If t 2 2 what is the expected number of copies of K, in a random graph НЕ G(n, p)?

A: random graphs, also known as Erd¨os-R´enyi random graphs. The degree of a node is the number of link...

Q: Write a Python program to input number of seconds and print it in form of HH:MM:SS.Like for 4000seco...

A: Note : Indentation is important in python programming. Python program for the given question as foll...

Q: Write a user-defined function that plots a triangle and the circle that is inscribed inside, given t...

A: Actually, function is a set of statements.

Q: 3. The table below shows instruction-type breakdown for different programs. Using this data, you w...

A: Execution time = clock rate* CPI ___________________________________________________________________...

Q: What's the answer for "It's inventiveness and certainty and futuristic ideas typically deal with sci...

A: Inventiveness is nothing but innovation which is part of almost each and every sector Certainty is n...

Q: Draw the UML class dagram to demonstrate the concepts of Inheritance, Composition Interfaces by cons...

A: Click to see the answer

Q: Help their can possibly be more than one correct answer!

A: there are two terms  accuracy -  this refer to the how closely  a values agrees with the true values...

Q: If an organization currently lacks the skills necessary to make a project technically feasible, how ...

A: In case an organization lacks the skills necessary to make a project technically feasible, the way o...

Q: please please help

A: V=[12,18,4,8,8];W=[14,0,3,1,0];A=V+W;d=0;for i = 1:length(V)    d=d+A(i)*A(i);enddisp(d)

Q: I’m working in c++ and can’t find what to put for the return value! I need it to get my arrays set u...

A: The requirement is to pass three empty arrays to a method named PopulateArray() and get that arrays ...

Q: What is the difference between void and NULL pointers .Give suitable examples in support of your ans...

A: A null pointer is one which is not pointing to anything, i.e. it is assigned a null value. If there ...

Q: Get 10 numbers from user using loop. Find which number is a. positive b. negative C. zero d. Odd e. ...

A: Algorithm: An algorithm is a set of steps used to solve a problem in natural language English. The r...