Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

C implementation to print the character and its frequency in the order of its occurre... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Networks

Authors: Andrew S. Tanenbaum, David J. Wetherall

5th edition

132126958, 978-0132126953

More Books

Students also viewed these Computer Engineering questions

Question

How have our views of gender changed in recent history?

Answered: 1 week ago

Question

What is the formula to calculate the mth Fibonacci number?

Answered: 1 week ago