subject
Computers and Technology, 10.10.2020 20:01 oomale

C++ F3 Sort using a 2-Dimension Array of characters 15pts

Task -> Same as last. Implement the function specifications/prototypes. The driver program main() has been supplied.

Input the size of the 2 dimensional character array, then sort by row. Note: this problem is repeated in question 8 but you are required there to modify the ascii code for the sort. Here just use strcmp().

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

//User Libraries Here

//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);//Sort by row
void print(const char [][COLMAX],int, int);//Print the sorted 2-D array

//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

//Input the size of the array you are sorting
cout<<"Read in a 2 dimensional array of characters and sort by Row"< cout<<"Input the number of rows <= 20"< cin>>rowIn;
cout<<"Input the maximum number of columns <=20"< cin>>colIn;

//Now read in the array of characters and determine it's size
rowDet=rowIn;
cout<<"Now input the array."< colDet=read(array, rowDet);

//Compare the size input vs. size detected and sort if same
//Else output different size
if(rowDet==rowIn&&colDet==c olIn){
sort(array, rowIn, colIn);
cout<<"The Sorted Array"< print(array, rowIn, colIn);
}else{
if(rowDet!=rowIn)
cout<<(rowDet "Row Input size greater than specified.")< if(colDet!=colIn)
cout<<(colDet "Column Input size greater than specified.")< }

//Exit
return 0;
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 23.06.2019 22:00
Take a critical look at three gui applications you have used—for example, a spreadsheet, a word-processing program, and a game. describe how well each conforms to the gui design guidelines listed in this chapter.
Answers: 3
question
Computers and Technology, 24.06.2019 16:00
"gps interaction and cognitive process" respond to the following: imagine that you have been asked to design a gps product that will have voice recognition and bluetooth capability. discuss and conceptualize a user interaction model. predict two (2) problems that may arise in gps products with voice recognition and bluetooth capability. recommend solutions for each of these issues. attention is one of the six cognition processes. when attention is applied to a design, the goal is to make it easier for the end user to quickly locate where he / she should type information on the computer or mobile device screen. compare and contrast how the google search engine and the microsoft bing search engine employ the attention cognition process. provide your opinion as to which search engine better employs the attention cognition process and explain why.
Answers: 3
question
Computers and Technology, 25.06.2019 00:10
Select the correct answer sarah wants to use a device to input signatures on electronic documents. which input device will be most suitable for her? a digital pen b. laser pen c keyboard d. touchscreen reset next
Answers: 2
You know the right answer?
C++ F3 Sort using a 2-Dimension Array of characters 15pts

Task -> Same as last. Imp...
Questions
question
Mathematics, 13.04.2020 23:33
question
History, 13.04.2020 23:33
question
SAT, 13.04.2020 23:34
Questions on the website: 13722362