Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ code: This is A C++ program question: Please use Loop Algorithms and you may not use stdafx.h. Consider only for loop and while loop.

C++ code:

This is A C++ program question:

Please use Loop Algorithms and you may not use stdafx.h.

Consider only for loop and while loop.

Write a program that reads a string and prints the most frequently occurring letter. If there are multiple letters that occur with the same maximum frequency, print them all. For example, if the word is mississippi, print is because i and s occur four times each, and no letter occurs more frequently.

You do not to worry about upper case

The maximum number of letters that tie for most frequent is three times and at least one repeated letter

Here is my code,

image text in transcribed

When I input "programming", only "r m" shows up, missed letter "g"

When I input "aaabc" , the output is "aa",

Could you please check my code.

10stream> #include 2 #include 3 4 using namespace std; 5 6 int main() 7-{ 8 string str; 9 string letter; 1e string letteri; 11 string dupi; 12 string dup2; 13 string dup3; 14 cout > str; A 16 int count = m; 17 int counti = 1; A 18 for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

Students also viewed these Databases questions

Question

4. What sales experience have you had?

Answered: 1 week ago