Question: All questions are in C. Exercise 8.2 Write a function called LetterHist() that takes a String as a parameter and that returns a histogram of
All questions are in C.
Exercise 8.2 Write a function called LetterHist() that takes a String as a parameter and that returns a histogram of the letters in the String. The zeroeth element of the histogram should contain the number of as in the String (upper and lower case); the 25th element should contain the number of zs. Your solution should only traverse the String once.
Exercise 8.3 A word is said to be a doubloon if every letter that appears in the word appears exactly twice. For example, the following are all the doubloons I found in my dictionary. Abba, Anna, appall, appearer, appeases, arraigning, beriberi, bilabial, boob, Caucasus, coco, Dada, deed, Emmett, Hannah, horseshoer, intestines, Isis, mama, Mimi, murmur, noon, Otto, papa, peep, reappear, redder, sees, Shanghaiings, Toto Write a function called IsDoubloon() that returns TRUE if the given word is a doubloon and FALSE otherwise.
Exercise 8.4 The Captain Crunch decoder ring works by taking each letter in a string and adding 13 to it. For example, a becomes n and b becomes o. The letters wrap around at the end, so z becomes m. a. Write a function that takes a String and that returns a new String containing the encoded version. You should assume that the String contains upper and lower case letters, and spaces, but no other punctuation. Lower case letters should be tranformed into other lower case letters; upper into upper. You should not encode the spaces. b. Generalize the Captain Crunch method so that instead of adding 13 to the letters, it adds any given amount. Now you should be able to encode things by adding 13 and decode them by adding -13. Try it.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
