This is for a programming assignment--I do not want you to write it for me!!!I need to understand how this works so that, later on, I can convert higher level languages, such as C, into Assembly and Machine language.
Specifications
"You will write a program that will take as inputs 1) a string of ASCII encoded characters, 2) a single character that we’ll call the search letter, and 3) a number that we’ll call n. The program will scan through the string, keeping track of three statistics that will be the output of your program. One statistic will be the count of the number of occurrences of the search letter in the string. The second statistic will be the number of occurrences of any letters that are up to n characters alphabetically before the search letter. The last statistic will be the number of occurrences of any letters that are up to n characters alphabetically after the search letter."
Counting the number of occurrences of the search letter in the string seems easy enough. However I have no idea how to count the number of occurrences of any letters that are +/- n characters away from the search letter.
Also, for this program, the test cases are limited to a maximum of n=12 when my search character is m. So I only have to worry about alphabetical characters and can ignore wrap around. Thanks for any help in advance.
This post was edited by Krister on Nov 9 2015 08:28pm