Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use C++ to create a one-dimensional array to read 20 alphabetical letters (your program should be able to detect and print out an error message

Use C++ to create a one-dimensional array to read 20 alphabetical letters (your program should be able to detect and print out an error message if a non-alphabetical letter is entered). As each letter is entered, print a message saying ?duplicate letter? if the letter is already in the array. Write a function that can sort the array after all 20 letters have been entered. Write another function that print out the most frequent letter and number of times it was entered. Prepare for the case where all 20 letters are different, or all are the same.

Sample output:

rince Raji-PC TSD TSD TP2 201?/week? ter 20 alphabets is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter is a duplicate letter. is a duplicate letter is a duplicate letter. is a duplicate letter is a duplicate letter he original array is: he sorted array is: l1 characters are the sane

https://d2vlcm61l7u1fs.cloudfront.net/media%2F958%2F958a658a-8bab-4416-8b42-57178b6226e8%2FphpNJZdlO.png

https://d2vlcm61l7u1fs.cloudfront.net/media%2F41e%2F41ea7feb-1901-4d3c-a217-9c922e5e0f3f%2Fphp9aX5Fw.png

Prince@Raji-PC /h/C-New/TSD/TSD_TP2_2017/week? Sa Enter 20 alphabets a is a duplicate letter. a is a duplicate letter. a is a duplicate letter. is a duplicate letter. a is a duplicate letter. a is a duplicate letter. a is a duplicate letter. a is a duplicate letter. is a duplicate letter. a is a duplicate letter. is a duplicate letter. a is a duplicate letter. is a duplicate letter. a is a duplicate letter. a is a duplicate letter. is a duplicate letter. a is a duplicate letter. a is a duplicate letter. a is a duplicate letter. The original array is: aaa The sorted array is: aaaaaaaaaaaaaaaaaaaa All characters are the sane. Prince@Raji-PC /h/C-New/TSD/TSD TP2_2017/week? a Enter 20 alphabets a 3 3 is not an alphabet b C d e n n 0 p 37804 P t The original array is: abcdefghijklmnopqrst The sorted array is: abcdefghijklmnopqrst All characters are entered only one time. Prince@Raji-PC /h/C-New/TSD/TSD_TP2_2017/week? $a Enter 20 alphabets a b is a duplicate letter. 4 is not an alphabet is not an alphabet d is a duplicate letter. d d is a duplicate letter. d is a duplicate letter. d is a duplicate letter. d d is a duplicate letter. f is a duplicate letter. 9 h d is a duplicate letter. d d is a duplicate letter. is a duplicate letter. d is a duplicate letter. f is a duplicate letter. The original array is: abaddddf ddf ghrddredf The sorted array is: aabdddddddddefffghrr The mode is 'd' and it is occuring 9 tines.

Step by Step Solution

3.39 Rating (152 Votes )

There are 3 Steps involved in it

Step: 1

include using namespace std void s... 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 Networking A Top-Down Approach

Authors: James F. Kurose, Keith W. Ross

5th edition

136079679, 978-0136079675

More Books

Students also viewed these Programming questions

Question

What is the difference between a virus, a worm, and a Trojan horse?

Answered: 1 week ago

Question

=+c. Given that the selected can had a surface defect,

Answered: 1 week ago