# assign3 - COP 3502 Summer 2002 Assignment#3 Due in class...

This preview shows pages 1–2. Sign up to view the full content.

Due in class: Wednesday July 10 th Problem #1 Assumptions: 1. Prompt the user to enter the value of n , assume that the maximum value of n is 20 for this program. Your program must check to be sure the user has entered a proper value for n . 2. User can enter both positive and negative values into the array. Example execution: Enter the number of elements in your array (1-20): 7 Enter number 1: -45 Enter number 2: -29 Enter number 3: 56 Enter number 4: -45 Enter number 5: -45 Enter number 6: 0 Enter number 7: 56 Number 56 appeared 2 times Number 0 appeared 1 time Number –29 appeared 1 time Number –45 appeared 3 times Problem #2 Assignment #3 - 1 Write a C program that reads n integers into an array, then prints on a separate line the value of each distinct element in the array along with the number of times it occurs in the array. The values must be printed in descending order. Your program must use different functions for the following tasks: 1. A function to read in the n integers and place them in the array. 2. A function which determines the distinct values and the number of times each occurs in the array. 3. A function which prints the distinct values and the number of occurrences for each in descending order. COP 3502 – Summer 2002 – Assignment #3 Write a C program that will read in a string of n characters (1 character at a time) then use a recursive function to reverse the string of characters and place them in to a second array in the reverse order from the original input order, and finally use another function to determine if the original string was a palindrome (a word or string that reads the same forward and backward). Your program should prompt the user for the original string, print out this string as well as the reverse of the string, and finally should print a message indicating if the string is a palindrome.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern