Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this program is in C++ and it supposed to take in any word and print out how many syllabus the word has #include #include #include

this program is in C++ and it supposed to take in any word and print out how many syllabus the word has

#include #include #include using namespace std; int main() { string word; cout > word; int count = 0; int i = 0; char currentLetter = word[i]; bool prev_letter_vowel = false; /* condition that we are starting with the first letter in the string, that we are checking all letters before the last letter and that if a vowel is detected, the count is incremented by 1 */ for(int i=0;i

/ewly added code for the desired output cout

the output is coming out like this:

image text in transcribed

And i want it to look like the second picture

image text in transcribed

Please enter a word : Hairy hairy hare the Word Syllabus Hairy 2 Please enter a word : Word Syllabus hairy 2 Please enter a word : Word Syllabus hare 1 Please enter a word : Word Syllabus the 1 Please enter a word : Word Syllabus Harry 2 hairy 2 hare 1 the 1

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

More Books

Students also viewed these Databases questions