Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this part of the lab, you will create a function check Array Sort that checks if an array of strings (which was previously defined
In this part of the lab, you will create a function check Array Sort that checks if an array of strings (which was previously defined and initialized) is already sorted, and it is either increasing or decreasing. The function that you create is declared as follows: Input arguments: A string array A (remember that array is a pointer in this case, so use the * sign) an integer variable array_size for the number of elements in array A (the counter value from previous exercise) Return in integer value: -1 if the array is sorted in descending order 0 if the array is not sorted 1 if the array is sorted in ascending order You can modify the main program that you developed in filelO.cpp to call check Array Sort, and to print out one of the following statements: If -1 "The array is sorted in descending order!" If 0 "The array is not sorted!" If 1 "The array is sorted in ascending order!" You can use the same words_in.txt to test your program
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started