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
Sphinxa [80]
3 years ago
7

Modify the selectionSort function presented in this chapter so it sorts an array of strings instead of an array of ints. Test th

e function with a driver program. Use program 8-8 as a skeleton to complete.
Program 8-8

#include

#include

using namespace std;

int main()

{

const int NUM_NAMES = 20

string names [NUM_NAMES] = {"Collins, Bill", "Smith, Bart", "Allen, Jim", "Griffin, Jim", "Stamey, Marty", "Rose,Geri", "Taylor, Terri", "Johnson, Jill", "Allison, Jeff", "Looney, Joe", "Wolfe, Bill", "James, Jean", "Weaver, Jim", "Pore, Bob", "Rutherford, Greg", "Javens, Renee", "Harrison, Rose", "Setzer, Cathy", "Pike, Gordon", "Holland, Beth" };

//Insert your code to complete this program

return 0;

}

Computers and Technology
1 answer:
nirvana33 [79]3 years ago
5 0

Answer:

Following are the method to this question:

void selectionSort(string strArr[], int s) //defining selectionSort method

{

int i,ind; //defining integer variables

string val; //defining string variable

for (i= 0; i< (s-1);i++) //defining loop to count value

  {

      ind = i; //assign loop value in ind variable

      val = strArr[i]; // strore array value in string val variable

      for (int j = i+1;j< s;j++) // defining loop to compare value

      {

          if (strArr[j].compare(val) < 0) //using if block to check value

          {

              val = strArr[j]; //store value in val variable  

              ind= j; //change index value

          }

      }

      strArr[ind] = strArr[i]; //assign string value in strArray  

      strArr[i] = val; // assign array index value

  }

}

void print(string strArr[], int s) //defining print method

{

  for (int i=0;i<s;i++) //using loop to print array values

  {

      cout << strArr[i] << endl; //print values

  }

  cout << endl;

}

Explanation:

In the above-given code, two methods "selectionsort and print" is declared, in which, both method stores two variable in its parameter, which can be described as follows:

  • Insides the selectionSort method, two integer variable "i and ind" and a string variable "val" is defined, inside the method a loop is declared, that uses the if block condition to sort the array.
  • In the next line, another method print is declared that declared the loop to prints its value.
  • Please find the attachment for full code.

You might be interested in
Which single OSPF network statement will correctly include all the interfaces on a device whose IP addresses only begin with a 1
tester [92]

Answer:

network 10.10.8.0 0.0.3.255 area 0

this will include all the interfaces on a device whose IP addresses only begin with a 10.10.8, 10.10.9, 10.10.10, or 10.10.11.

Explanation:

<em>show ip ospf interface </em>

<em>show ip ospf interface brief</em>

these commands are used to display the interfaces that have been enabled into local ospf . it also shows explanation about them by brief command mentioned above.

<em />

4 0
3 years ago
Give two differences between ergonomic keyboard and standard keyboard?​
galina1969 [7]

Answer:

The biggest difference between enhanced keyboards is the 12 function keys running across the top of the keyboard, instead of 10 that run down the left side. Other changes include the addition of extra Ctrl, keys, Alt keys, and cursor arrow keys between the letter keys and numeric keypad on the right side.

Explanation:

5 0
2 years ago
How do you change the username on here?
never [62]

Answer:

I don't think you can. You can try to make an email that has the name you want and use that.

Explanation:

6 0
3 years ago
Work done by computer as per the instructions is called​
Alex17521 [72]

Answer:

The process of storing and then performing the instructions is called “running,” or “executing,” a program. By contrast, software programs and procedures that are permanently stored in a computer's memory using a read-only (ROM) technology are called firmware, or “hard software.”

Explanation:

hope it helps you and give me a brainliest

6 0
2 years ago
Read 2 more answers
A method can not be made final until whole class is madefinal.<br> ? True<br><br> ? False
Lynna [10]

Answer:

True.

Explanation:

A method can not be made final until whole class is madefinal.

3 0
3 years ago
Other questions:
  • ​to prevent intrusions, companies install combinations of hardware and software called _____ to keep unauthorized web users from
    9·1 answer
  • Public places where you can wirelessly connect to the internet are known as wifi ________.
    11·1 answer
  • Traffic that is encrypted will typically pass by an intrusion prevention system untouched.a. Trueb. False
    10·1 answer
  • Write a function named "higher_lower" that takes an int as a parameter and returns "higher" if 14 is greater than the input and
    11·1 answer
  • Which of these is the most likely result if the internet download speed in your home is 25 Mbps?
    14·1 answer
  • Z-Wave and Zigbe use a _______________ networking topology to facilitate communication in homes, yet both also have hubs that ac
    8·1 answer
  • Can somebody help me out
    15·1 answer
  • True or false: The objective of an Enterprise Resource Planning (ERP) system is to create a customized software program that int
    10·1 answer
  • CS902 Module3 Homework1
    11·1 answer
  • An entity is said to be _____-dependent if it can exist in the database only when it is associated with another related entity o
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!