Specification: Read sentences from the user until * is entered. Show the number of words in each sentence that contain a stretch of non-z characters with exactly 2 vowels. A stretch starts from the start of the word or after a 'z'. A stretch terminates just before another 'z' or at the end of the word. Examples: 1. Matching words: zoo, azozooza, GONZALEZ 2. Non-matching words: ozo, azoooza The sentences contain no punctuation, the words are separated by one or more spaces, and the characters may be upper or lower case. Keep reading sentences until the user enters "*". Sample I/O: Sentence: azoooza azooza zoo azoo Matching words = 3 Sentence: GONZALEZ passes the ball to VAZQUEZ Matching words = 3 Sentence: azozototzeti Matching words = 1 Sentence: * Done

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter7: User-defined Simple Data Types, Namespaces, And The String Type
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question
Specification:
Read sentences from the user until * is entered. Show the number of
words in each sentence that contain a stretch of non-z characters with
exactly 2 vowels. A stretch starts from the start of the word or after a 'z'. A
stretch terminates just before another 'z' or at the end of the word.
Examples:
1. Matching words: zoo, azozooza, GONZALEZ
2. Non-matching words: ozo, azoooza
The sentences contain no punctuation, the words are separated by one
or more spaces, and the characters may be upper or lower case. Keep
reading sentences until the user enters "*".
Sample I/O:
Sentence: azoooza azooza zoo azoo
Matching words = 3
Sentence: GONZALEZ passes the ball to VAZQUEZ
Matching words = 3
Sentence: azozototzeti
Matching words = 1
Sentence: *
Done
Transcribed Image Text:Specification: Read sentences from the user until * is entered. Show the number of words in each sentence that contain a stretch of non-z characters with exactly 2 vowels. A stretch starts from the start of the word or after a 'z'. A stretch terminates just before another 'z' or at the end of the word. Examples: 1. Matching words: zoo, azozooza, GONZALEZ 2. Non-matching words: ozo, azoooza The sentences contain no punctuation, the words are separated by one or more spaces, and the characters may be upper or lower case. Keep reading sentences until the user enters "*". Sample I/O: Sentence: azoooza azooza zoo azoo Matching words = 3 Sentence: GONZALEZ passes the ball to VAZQUEZ Matching words = 3 Sentence: azozototzeti Matching words = 1 Sentence: * Done
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning