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