Can anyone help me with this project, I cannot figure it out.

Enter characters one by one until a predetermined “sentinel” or the maximum number of characters is entered. The maximum MUST be less than 96. The sentinel character can be any character other than an italic alpha or, space or a numeral (for example a # (pound) sign might be used).

Keep a frequency count of each of the italic alphas (upper and lower are deemed to be identical). Also keep a frequency count of other characters entered.

Output a frequency count of each italic alpha, and the others.
Determine which italic alpha occurred most often.
Output the stream entered in uppercase transposed form [ A becomes B , B becomes C etc; Z becomes A ].

Do not use any library functions.

Reference:

ASCII character set (APPENDIX C)
Fact – characters are really small integers.
Strings are NULL Terminated.

Recommended Answers

All 3 Replies

there are 255 characters in the ascii character set (only about half are printable), so all you have to do is create an int array of 255 and use the char as an index into that array. When all done, loop through the array and print out the values for items greater than zero.

int array[255] = {0};
//
//
char c = 'A'; // assume letter'A' was entered
//
// increment array
++array[c];

Thanks, but I need only 96 characters, not 255.

there are 255 characters in the ascii character set (only about half are printable), so all you have to do is create an int array of 255 and use the char as an index into that array. When all done, loop through the array and print out the values for items greater than zero.

int array[255] = {0};
//
//
char c = 'A'; // assume letter'A' was entered
//
// increment array
++array[c];

Thanks, but I need only 96 characters, not 255.

The maximum number of characters that someone will enter is 96. This is not the same as the actual value of the characters. The array I mentioned can handle any key you can type on the keyboard, plus a few you can't type. It doesn't really matter that the array is actually larger than you need. If this were a c++ program I would have suggested a better method (map), but you are explicitly instruced to not use any library functions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.