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
Question 4
Tcecarenko [31]

Answer: squared ← number * number

Explanation:

4 0
3 years ago
In order for the wavelength of a wave to increase, the frequency must...
kari74 [83]
Decrease. Think like this, if you were standing in the ocean getting hit by waves, frequency would be how many waves hit you in a certain amount of time. If there were lots of little waves hitting you the number of waves (the frequency) would be high, whereas big waves are slower and take more time to reach you so you would get hit by less of them in the same time frame. The less frequent, the longer the wave. 
7 0
3 years ago
A ___________ allows Internet telephony service providers to deliver telephony services and unified communications applications
Firlakuza [10]

Answer: SIP Trunk

Explanation:

   The SIP is stand for the session initiation protocol trunk is one of the service that is specifically provided by the service provider and the main purpose of the SIP trucking is to manage the VoIP call process (Voice over IP).

According to the given question, SIP is one of the protocol that allow telephony services for the communication purpose and it also offer the video, Message, media and the voice application and these process are control by using this type of technology.  

 Therefore, SIP Truck is the correct answer.  

8 0
3 years ago
What is the database and presentation for files​
Nutka1998 [239]

Answer:

Database Management System ppt DBMS

I don't know if that is right. Sorry if it's not.

6 0
2 years ago
Read 2 more answers
_____ is a secret or illegal cooperation or conspiracy, especially in order to cheat or deceive others.A.CollusionB.Business eth
finlep [7]

The answer would be A.Collusion.

3 0
3 years ago
Other questions:
  • The file extensions .webm, .m4v, and .ogv are used for:
    15·1 answer
  • How can touch typing quickly but accurately improve your earnings (the money you can make)
    15·2 answers
  • What is the magnitude of the largest positive value you can place in a bool? a char? an int? a float? a double??
    8·1 answer
  • Which type of computer network ensures high quality​
    9·1 answer
  • Write a loop that reads strings from standard input where the string is either "land", "air", or "water". The loop terminates wh
    14·1 answer
  • What is key to remember when handling linked lists?
    12·1 answer
  • What system calls have to be executed by a command interpreter? Why is it usually separate from the kernel?
    12·1 answer
  • An important communication principle states ""prepare before you communicate."" How should this preparation manifest itself in t
    10·1 answer
  • Find what the secret message is. Get Brainliest if you are fast and correct.
    13·2 answers
  • Help plz (will give brainliest)
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!