Question: Write an efficient C++ program that takes a string input (a single line) from the user and displays the number of words, characters, alphabets, vowels,

 Write an efficient C++ program that takes a string input (asingle line) from the user and displays the number of words, characters,

Write an efficient C++ program that takes a string input (a single line) from the user and displays the number of words, characters, alphabets, vowels, consonants and digits in that given string. For our purposes, characters are everything that isn't whitespace (tabs or spaces), alphabets are letters from a...z or A...Z, digits are from 0...9, and words are any non-whitespace characters separated by whitespace. So in the sentence "I have 32 oranges..., which is a strange thing. (!) " there are 10 words, including "I", "32" and "(!)" and treating "oranges...," as one word. If you are using any code developed in class, be sure to cite your teammates in the header comments. In order to placate the auto-grader, the output has to be in the order and format below: Number of alphabets =32 Number of vowels =12 Number of consonants =20 Number of digits =2 Number of characters =42 Number of words =10 465922.2641388.q3zqy7 4.10.1: String Report 6/16 4:Compare output Output differs. See highlights below. Input !0! All shall love me and despair! 10 ! Number of alphabets =24 Number of vowels =9 Your output Number of consonants =15 Number of digits =2 Number of characters =35 Number of words =10 Number of alphabets =24 Number of vowels =9 Expected output Number of consonants =15 Number of digits =2 Number of characters =31 Number of words =8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!