1. Engineering
  2. Computer Science
  3. asap please include include using namespace std implement recursive...

Question: asap please include include using namespace std implement recursive...

Question details

Spring 2019 EPP Problem 3. Write a recursive function called are in ascendling order (same as in Problem 1). isAscending takes three parameters: isAscending to determine if the elements of an integer array 1. the integer array the starting index of the array integer). The function only looks at values starting from this index the ending index of the array (integer). The function only looks at values ending at this index 3. isAscending should return true if the elements between the starting and ending index parameters are in ascending order, or false otherwise. A main function is given to you to read in the array in prob3.cpp. The main function then calls isascending with starting index O and ending index-length of the array-1. You are to add only the recursive function to this file. A sample run is given below Enter number of integers: 5 Enter 5 integers: 10 17 23 45 92 Output of İsAscending: 1 Another example: Enter number of integers: 5 Enter 5 integers: 92 45 10 23 17 output of İsAscending: 0 A non-recursive version of the function will get no credit. The function should not have any loops at all. Do not use any global variables. Write only the recursive function in the space provided. Do NOT change the main function. Do not change the main function (other than for your own testing) Do NOT use any STL classes (such as std::vector). File submission: Upload exactly one file to Titanium 1. prob3.cpp//asap please!!!

#include
#include

using namespace std;

// Implement recursive function isAscending here

// DO NOT CHANGE MAIN FUNCTION BELOW
int main() {
   int myarray[100];
   cout << "Enter number of integers : ";
   int n;
   cin >> n;
   cout << "Enter " << n << " integers" << endl;
   for (int i = 0; i < n; i++)
       cin >> myarray[i];
   cout << "Output of isAscending : " << isAscending(myarray, 0, n-1) << endl; /////do not change anything here.
}

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution