Question: C++ code: Write a program In C++ that reads a sentence from the keyboard. Then cout how many hyphenated words are in the sentence and
C++ code:
Write a program In C++ that reads a sentence from the keyboard. Then cout how many hyphenated words are in the sentence and how many quoted words are in the sentence.
--------------------------------------------------------------
Example 1:
Enter sentence:
Joe likes quasi-sci-fi books like "Left Hand of Darkness" and "Frankenstein"
Words with hyphens:
1
Words in quotes
5
Example 2:
Enter sentence:
"jack is happy"
Words with hyphens:
0
Words in quotes :
3
Example 3:
Enter sentence:
this is a "hyphenated-word" in quotes
Words with hyphens:
1
Words in quotes :
1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
