in C++ please For this problem you must create a program that accepts a line of English text as input. The string may contain spaces, so make sure you read the entire line of input. Next your program should count the occurrences of each letter of the English alphabet and determine which letter occurs most frequently in the string. Print this letter to the screen. If two letters tie for the most frequent count, break the tie by choosing the letter that occurs first in the alphabet. For example if the input string was "aabb", then your program should identify 'a' as the most frequently occurring letter. Finally, remove all occurrences of this most frequently occurring letter by replacing them with the '-' character, and print the final string to the screen. Sample Input aaaab Sample Output a ----b Simplifying Assumptions You may assume that all letters are lowercase You only need to count the letters of the alphabet (i.e. don't worry about counting special characters like punctuation, digits, etc.) If two letters tie for the most frequent count, break the tie by choosing the letter that occurs first in the alphabet.
in C++ please
For this problem you must create a program that accepts a line of English text as input. The string may contain spaces, so make sure you read the entire line of input. Next your program should count the occurrences of each letter of the English alphabet and determine which letter occurs most frequently in the string. Print this letter to the screen. If two letters tie for the most frequent count, break the tie by choosing the letter that occurs first in the alphabet. For example if the input string was "aabb", then your program should identify 'a' as the most frequently occurring letter.
Finally, remove all occurrences of this most frequently occurring letter by replacing them with the '-' character, and print the final string to the screen.
Sample Input
aaaab
Sample Output
a ----b
Simplifying Assumptions
- You may assume that all letters are lowercase
- You only need to count the letters of the alphabet (i.e. don't worry about counting special characters like punctuation, digits, etc.)
- If two letters tie for the most frequent count, break the tie by choosing the letter that occurs first in the alphabet.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 6 images