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
natka813 [3]
3 years ago
9

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

nction 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:

20 10 30 40 -1
then the output is:

40 10 30 20
40 30 10 20
40 30 20 10
Computers and Technology
1 answer:
salantis [7]3 years ago
8 0

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

void SelectionSortDescendTrace(int numbers[], int numElems) {

int maxInd;

for (int i = 0; i < numElems - 1; ++i) {

maxInd = i;

for (int j = i; j < numElems; ++j) {

if (numbers[j] > numbers[maxInd]) {

maxInd = j;

}

}

int temp = numbers[i];

numbers[i] = numbers[maxInd];

numbers[maxInd] = temp;

for (int j = 0; j < numElems; j++) {

cout << numbers[j] << " ";

}

cout << endl;

}

}

int main() {

int numbers[10];

int numElements = 0;

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

cin >> numbers[i];

if (numbers[i] == -1)

break;

++numElements;

}

SelectionSortDescendTrace(numbers, numElements);

return 0;

}

You might be interested in
What are specific and relevant terms that will help you locate information using an internet search engine?
Liono4ka [1.6K]
I would say A:keywords

Hope this helps

I’m sorry if this is wrong

Have a great day/night
3 0
2 years ago
A client is looking to maximize value from its Cloud investments by baselining, profiling, and prioritizing its human capital ne
barxatty [35]

myNav is to be present inn the Accenture software. It aim is to helps companies manage the human, technology and business dimensions of cloud change. The myNav module that will help this client is Cloud Advisor.

Cloud Advisor is simply known to be one of the many modules within the myNav platform. It was set up to handle the difficulties of cloud for digital transformation.

These Advisors are  known worldwide community of technical resources. They have a thorough  knowledge of cloud technologies and practices.

Their mission is to know the trends, regulatory implications, and our clients' needs so as to help them to set goals and create plans to achieve their desired outcome.

Learn more from

brainly.com/question/24918185

3 0
2 years ago
Choose the correct definition for Conditional Statement A. Affects the sequential flow of control by executing different stateme
Sliva [168]

Answer:

A: Affects the sequential flow of control by executing different statements based on the value of a Boolean expression

Explanation

because the real definition is Definition. A conditional statement is a statement that can be written in the form “If P then Q,” where P and Q are sentences. For this conditional statement, P is called the hypothesis and Q is called the conclusion. Intuitively, “If P then Q” means that Q must be true whenever P is true. And A, explain that.

5 0
3 years ago
Read 2 more answers
Create a new Die object. (Refer to Die.html for documentation.)Create a loop that will iterate at least 100 times. In the loop b
hjlf

Answer:

Java code is given below

Explanation:

import java.util.Random;

class Die{

private int sides;

public Die(){

sides = 6;

}

public Die(int s){

sides = s;

}

public int Roll(){

Random r = new Random();

return r.nextInt(6)+1;

}

}

class DieRoll{

public static void main(String[] args) {

Die die = new Die();

int arr[] = new int[6];

for(int i=0; i<6; i++)

arr[i] = 0;

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

int r = die.Roll();

arr[r-1]++;

}

for(int i=0; i<6; i++)

System.out.println((i+1)+" was rolled "+arr[i]+" times.");

}

}

8 0
3 years ago
Which of these benefits can be achieved whensoftware is restructured?
Ivenika [448]

Answer:

iv. all of the given options

Explanation:

This is the correct answer because this is what happens when software is restructured.

<em>PLEASE</em><em> </em><em>DO MARK</em><em> </em><em>ME AS</em><em> </em><em>BRAINLIEST</em><em> </em><em>IF</em><em> </em><em>MY ANSWER</em><em> </em><em>IS HELPFUL</em><em> </em><em>;</em><em>)</em><em> </em>

4 0
3 years ago
Other questions:
  • What is computer? Explain the characteristics of computer.<br>​
    12·1 answer
  • A computer program that senses when another computer is attempting to scan or access a computer or network is called an
    7·1 answer
  • Im being timed please help!!
    7·2 answers
  • Domain of (x+8)/(x(x+10))
    12·1 answer
  • Heres the last questions
    5·1 answer
  • Whats a hybrid wired network
    9·1 answer
  • The pay of an hourly worker is calculated by multiplying the hours worked by the hourly rate—up to 40 hours; any hours worked be
    11·1 answer
  • Effective scrum masters apply which coaching behavior
    5·1 answer
  • Is majority intent determined by how many times the same type of result is shown on the search engine result page?
    6·1 answer
  • How does xm satellite deter nonsubscribers from listening to its transmissions? Does this make the radio programing a private go
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!