Question: Design and implement a easy C++ program with array and string read in a whole line of characters as the input string; count and display

Design and implement a easy C++ program with array and string

  • read in a whole line of characters as the input string;
  • count and display how many times
  • how frequently (among the letters) each (case insensitive) letter appears in the above mentioned input string;

Sample program execution:

An example of executing such a program is shown below. Note that the user input is in italic font.

Please enter a line of characters:This is a really long line of characters! There are 41 characters in the input line. And among them, 33 are letters.   letter  number   frequency       A       4    0.121212       B       0           0       C       2   0.0606061       D       0           0       E       3   0.0909091       F       1    0.030303       G       1    0.030303       H       2   0.0606061       I       3   0.0909091       J       0           0       K       0           0       L       4    0.121212       M       0           0       N       2   0.0606061       O       2   0.0606061       P       0           0       Q       0           0       R       3   0.0909091       S       3   0.0909091       T       2   0.0606061       U       0           0       V       0           0       W       0           0       X       0           0       Y       1    0.030303       Z       0           0

Step by Step Solution

3.49 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

C implementation to print the character and its frequency in the order of its occurre... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Engineering Questions!