Question: Implement the function prototypes to solve the problem. This problem was solved in question 4 but it has a twist. Before you sorted with respect

Implement the function prototypes to solve the problem.

This problem was solved in question 4 but it has a twist. Before you sorted with respect to the ascii table using string compare -> strcmp() from the library. You can use the same code but you will have to create your own strcmp(). The reason is you are going to change the sort order. This time you will input a character array to change the sort order. Then do the sort.

Please use the following template and provide the following output:

#include //cin,cout #include //strlen(),strcmp(),strcpy() using namespace std;

//Global Constants Only, No Global Variables //Allowed like PI, e, Gravity, conversions, array dimensions necessary const int COLMAX=80;//Only 20 required, and 1 for null terminator

//Function Prototypes Here int read(char [][COLMAX],int &);//Outputs row and columns detected from input void sort(char [][COLMAX],int,int,const char[],const char[]);//Sort by row using strcmp(); void print(const char [][COLMAX],int,int);//Print the sorted 2-D array //int strcmp(char a[],char b[],char replace[],char with[]){ int strcmp(char [],char [],const char [],const char []);//Replace sort order

//Program Execution Begins Here int main(int argc, char** argv) { //Declare all Variables Here const int ROW=30; //Only 20 required char array[ROW][COLMAX]; //Bigger than necessary int colIn,colDet,rowIn,rowDet;//Row, Col input and detected char replace[COLMAX],with[COLMAX];//New sort order //Input the new sort order then sort cout>replace; cout>with; cout>rowIn; cout>colIn; //Now read in the array of characters and determine it's size rowDet=rowIn; cout

Use input

1234

9876

3

3

111

222

333

Implement the function prototypes to solve the problem. This problem was solved

Expected Output Modify.the.sort_orderby.swapping these characters. With the following characters Readina2dimensional.array of characters.and.sort.by. Rowe Input: the number of rows

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!