C++ help please!! Write a recursive function named reverse With in Bounds that has an argument that is an array of characters and two arguments that are bounds on array indices. The function should reverse the order of those entries in the array whose ind

computer science

Description

C++ help please!! Write a recursive function named reverse With in Bounds that has an argument that is an array of characters and two arguments that are bounds on array indices. The function should reverse the order of those entries in the array whose indices are between the two bounds (including the bounds). For example, if the array is: a[0] == 'A' a[1] == 'B' a[2] == 'C' a[3] == 'D' a[4] == 'E' and the bounds are 1 and 4, then after the function is run the array elements should be: a[0] == 'A' a[1] == 'E' a[2] == 'D' a[3] == 'C' a[4] == 'B' Embed the function in a program and test it. After you have fully debugged this function, define another function named reverseCstring that takes a single argument that is a C string and modifies the argument so that it is reversed. 


This function will include a call to the recursive definition you did for the first part of this project, and need not be recursive. Embed this second function in a program and test it. Turn in only this final result (with output, of course). A palindrome is a string that reads the same forward and backward. Write a program that reads in any number of myStrings of characters from the user and determines if each myString is a palindrome. The user will terminate each myString by pressing the return (or enter) button. The user will indicate that there are no more myStrings by entering "quit". Do not make any changes to the myString class. Do not use the C++ string class. To do this you must write a recursive function named isAPalindrome that takes a single MyString argument and two arguments that are bounds on array indices. The function must examine the part of the argument between the two bounds (including the bounds) and return true if this part of the argument is a palindrome, false if it is not a palindrome. The function must be recursive and must not call any other functions that would do a significant part of the work. For example, calling ispunct() would be ok. Calling a function to reverse the array would not be ok. Follow this sample output closely: Enter a string: Able was I, ere I saw Elba Able was I, ere I saw Elba is a palindrome. Enter a string: peanut butter peanut butter is not a palindrome. Enter a string: quit In determining whether a string is a palindrome, this function must consider uppercase and lowercase letters to be the same and ignore punctuation characters and whitespace characters. You should not modify the argument in any way to accomplish this. 


The simplest way to handle uppercase/lowercase issues is to make everything uppercase on the fly, right at the instant that you are comparing the two characters. You will want to use three functions that are in the cctype library (i.e. you must #include cctype to use them). They are ispunct(char), a bool function which returns true if its argument is a punctuation mark and false otherwise, isspace(char), which returns true if its argument is a whitespace character and false otherwise, and toupper(char), which returns the uppercase equivalent of its argument (without changing the argument itself). I strongly suggest that you first write this program so that it works in the general case (i.e. assuming that all letters are uppercase and no characters are punctuation characters or whitespace characters), and then add code to handle the uppercase/lowercase and puncuation/whitespace issues. Write a recursive function to sort an array of integers into ascending order using the following idea: place the smallest element in the first position, then sort the rest of the array by a recursive call. This is a recursive version of the selection sort. (Note: You will probably want to call an auxiliary function that finds the index of the smallest item in the array. Make sure that the sorting function itself is recursive. Any auxiliary function that you use may be either recursive or iterative.) Embed your sort function in a driver program to test it. Turn in the entire program and the output. There are should be three files, a13_1.cpp, a13_2.cpp, and a13_3.cpp


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.