Question: Problem 1 (10 points Write a program that reverses the contents of an array of characters, counts the number of occurrences of each character in

 Problem 1 (10 points Write a program that reverses the contents

of an array of characters, counts the number of occurrences of each

character in the array, and finally displays the reversed array and the

Problem 1 (10 points Write a program that reverses the contents of an array of characters, counts the number of occurrences of each character in the array, and finally displays the reversed array and the computed counts. The goal MU main) 1. int arraySize-10; 2. Declare an array of chars: char d(arraySize: 3. Initialize the array by storing some character in each array index. 4. Call a function to print the array: display_array_of_chars(d, arraySize) 5. Call a function to reverse the array: reverse array_of_chars(d, arraySize) 6. Call a function to print the reversed array: display_array of chars(d, arraySize) 7. Declare an array to store the counts to be computed: int counts[arraySizel; 8. Declare an array to store the characters for which counts have already been computed: char counted charsarraySize] 9. int index-0; 10. for (int i 0; icarraySize; i) if (!has-been counted(counted-chars, d[i], index) (i.e., ifthe character d[i] has not already been counted then) a. counts[index]-count_ occurrencesld, dli], arraySize); counted_chars[indexl-dlil] indext+ 11. Call a function to display the counts: display counts(counts, counted_chars, index) void reverse array_ of chars(char a, int size) 1. Navigate the array and reverse the contents as follows

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!