Question: In C++, write two functions named printArray and deleteRepeats along with a main to test them according to the following specifications. Be sure to use

In C++, write two functions named printArray and deleteRepeats along with a main to test them according to the following specifications. Be sure to use function prototypes and place the actual function definitions after main.

printArray will take two parameters: an array of characters and an integer representing the number characters stored in the array. It will print the characters from the array, labeled by their index, to the screen up to the specified size.

deleteRepeats will take the same two parameters, except that the integer must be passed by reference. The function must remove any repeated characters from the array and reduce the size to match the reduced number of characters. The contents of the array beyond the newly reduced size do not matter.

main must test deleteRepeats with 4 different sets of data. For each test, you will print the array, call deleteRepeats, and then print the array again. One data set must contain only unique characters. One data set must contain one character repeated several times. Two will be different mixtures of characters, including some repetition. Make sure at least of your arrays is completely full to start with and that at least one of them is not completely full to start with.

There should be no user interaction in this program.

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!