| | |
string summary analysis
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2009
Posts: 1
Reputation:
Solved Threads: 0
i need help on how to create a C++ program that will input string of characters and will count the number of different vowels, consonants and symbols included in the string.
Input a string => "program!"
total letter 'a' => 1
total letter 'e' => 0
total letter 'i' => 0
total letter 'o' => 1
total letter 'u' => 0
total vowels => 2
total consonants => 5
total symbols => 1
total characters => 8
Input a string => "program!"
total letter 'a' => 1
total letter 'e' => 0
total letter 'i' => 0
total letter 'o' => 1
total letter 'u' => 0
total vowels => 2
total consonants => 5
total symbols => 1
total characters => 8
Create 5 integers that will accumulate the counts for each vowel.
C++ Syntax (Toggle Plain Text)
print prompt to enter string accept keyboard input into std::string or character array variable loop through each character in the string beginning of loop test for vowel if 'a' then increment a-counter else if 'e' then increment e-counter etc. for each vowel end of loop print the value of each vowel counter
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Someone said that a program is algorithm+data structures.
Ancient has given you the algorithm. I would like to recommend a data structure:map to store the number of occurrence of each vowel.
Ancient has given you the algorithm. I would like to recommend a data structure:map to store the number of occurrence of each vowel.
Siddhant Sanyam
(Not posting much)
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
(Not posting much)
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
![]() |
Other Threads in the C++ Forum
- Previous Thread: Help Updating Different Window in MFC
- Next Thread: parsing conf file in c++
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count data delete deploy desktop developer directshow dll download dynamic encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node number output parameter pointer problem program programming project proxy python read recursion recursive return string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






