Guest_imported
New member
- Jan 1, 1970
- 0
Hi, I need help writing a function that reads in a integer n from the user and displays the nth term in the array.
I have an array of size 26, Array[26].
0 is assigned letter 'a'
and 25 is assigned 'z' and so on for the rest of the letters
My program opens an infile and counts how many times each letter appeared.
So if it counts 67 letter 'a's then Array[0] = 67
" " "" " "" " ' " 89 letter 'k's then Array[10] = 89
etc for each letter.
I have that implemented but here is the problem.
The user inputs an integer into the function say 9. I want to output to the user the 9th highest occuring index.
So say the letter m, has the 9th highest value in the array. I want to output the index of m ie 13
The user inputs an integer into the function say 2. I want to output to the user the 2nd highest occuring index.
So say the letter d has the 2nd highest value in the array. I want to output the index of d ie 3
I have the rest of the program working well except for this part. Much help would he appreciated.
I have an array of size 26, Array[26].
0 is assigned letter 'a'
and 25 is assigned 'z' and so on for the rest of the letters
My program opens an infile and counts how many times each letter appeared.
So if it counts 67 letter 'a's then Array[0] = 67
" " "" " "" " ' " 89 letter 'k's then Array[10] = 89
etc for each letter.
I have that implemented but here is the problem.
The user inputs an integer into the function say 9. I want to output to the user the 9th highest occuring index.
So say the letter m, has the 9th highest value in the array. I want to output the index of m ie 13
The user inputs an integer into the function say 2. I want to output to the user the 2nd highest occuring index.
So say the letter d has the 2nd highest value in the array. I want to output the index of d ie 3
I have the rest of the program working well except for this part. Much help would he appreciated.