Question: Assume a is an arbitrary array of integer values. As an example, considerwhere MAXARRAY is the maximum number of data items that can be stored
Assume is an arbitrary array of integer values. As an example, considerwhere MAXARRAY is the maximum number of data items that can be stored in the array, and asize is the current number of items held in a
Requirement
You are asked to write the function
void deleteDuplicatesint a int& asize
to modify the array content so that each of its initial values will appear only once in the new version of the array. For instance, the sample array above will become Observe its size asize changes from to elements the duplicate values and are written only once Please, note that the parameter asize is supplied by reference.
Requirement
Write a function to tell how many times a given value appears inside an array. The method's header follows
int countOccurrencesint a int asize, int item; where is the array and asize its size. The parameter item is the value to be counted. For example, assume the array a given above. The call countOccurrencesa assize, returns number of times that occurs in the array a
Requirement
Your function deleteDuplicates MUST be designed so it relies on the countOccurrences method to create the solution.
Requirement
Write a function void printArraystring caption, int a int asize; to print a caption and then the array's contents see sample below
ADITTIONAL PROBLEMSPECS.
Do not use sortingthearrays as a solution strategy.
You must use prototypes. The first function in your source code must be main All the userdefined functions must be listed after the main method. Failure to organize the app this way will result in a points deduction.
Your app must work for any given integer array.
Do not display anything inside the deleteDuplicates function.
Submit your answer using the same formatting style applied to Lab reports code snapshot
Sample output your
app must produce.
Initial array
Modified array
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
