Write a program which will prompt the user to enter a string from the keyboard. The program should then count and report the number of words and characters in the string. The program should also count and report the number of times each letter of the alphabet occurs in the string, and print the percentage of the total represented. Using the principles discussed in the class for finding the maximum element of an array, find the letter of the alphabet that occurs most frequently in the sentence. Continue the whole process until the user enters nothing for the input.
• The user may enter up to 80 characters.
• need to have the following functions:
1. ToUpper: converts a lower case character into an upper case character.
2. PrintResult.
the output should look like below
Letter Occurrence Percentage
--------- ------------------ -----------------
A 4 8%
B 1 2%
C 1 2%
D 2 4%
E 12 25%
F 1 2%
G 1 2%
H 3 6%
I 2 4%
K 1 2%
L 1 2%
N 2 4%
O 2 4%
R 1 2%
S 2 4%
T 4 8%
V 2 4%
W 6 13%
about character and string
Page 1 of 12 Replies - 780 Views - Last Post: 07 December 2007 - 03:35 PM
Replies To: about character and string
#2
Re: about character and string
Posted 07 December 2007 - 02:28 AM
Read the rules, before posting.
Post your codes, let us see how we can help you
Post your codes, let us see how we can help you
#3
Re: about character and string
Posted 07 December 2007 - 03:35 PM
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.
Post your code like this:
Thanks.
Post your code like this:
Thanks.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|