2. Using the algorithm developed above, create a function that determines the status of the first character of a word. The function should receive a string containing a single word as the first parameter which should be defined as constant, and integer reference parameters containing the counts for the number of vowels, consonants and numbers found in a sentence. The main function should open a file containing sentences, read each sentence, and use the function to add to the counts for each word of the sentence. The main function should output each sentence read from the file and the total counts for each sentence. Hints: Each sentence from the file must be parsed into individual words which the function can examine. You may assume words will be separated by a single space.The find and substr string methods can assist in the parsing of the sentence. Alternatively, you may use a stringstream object to parse each line read from the file. See Strings.cpp and StringStream.cpp examples. Please see http://www.cplusplus.com/reference/string/string/e to learn more about using the find and substr functions and http://www.cplusplus.com/reference/sstream/istringstream/str/ e to learn about the istringstream class. The text input can be created with any simple text editor such as NotePad. InjGrasp, text files can be created be selecting New | Plain Text from the File menu. Store the text file in the same folder as the program. Example run: Input string: There are 3 cats in the yard! 2 words begin with a vowel 4 words begin with a consonant 1 other 'words' were found Input string: Fall is a beautiful time of year. 3 words begin with a vowel 4 words begin with a consonant O other 'words' were found Input string: There are 12 inches in a foot. 4 words begin with a 2 words begin with a consonant 1 other 'words' were found vowel
2. Using the algorithm developed above, create a function that determines the status of the first character of a word. The function should receive a string containing a single word as the first parameter which should be defined as constant, and integer reference parameters containing the counts for the number of vowels, consonants and numbers found in a sentence. The main function should open a file containing sentences, read each sentence, and use the function to add to the counts for each word of the sentence. The main function should output each sentence read from the file and the total counts for each sentence. Hints: Each sentence from the file must be parsed into individual words which the function can examine. You may assume words will be separated by a single space.The find and substr string methods can assist in the parsing of the sentence. Alternatively, you may use a stringstream object to parse each line read from the file. See Strings.cpp and StringStream.cpp examples. Please see http://www.cplusplus.com/reference/string/string/e to learn more about using the find and substr functions and http://www.cplusplus.com/reference/sstream/istringstream/str/ e to learn about the istringstream class. The text input can be created with any simple text editor such as NotePad. InjGrasp, text files can be created be selecting New | Plain Text from the File menu. Store the text file in the same folder as the program. Example run: Input string: There are 3 cats in the yard! 2 words begin with a vowel 4 words begin with a consonant 1 other 'words' were found Input string: Fall is a beautiful time of year. 3 words begin with a vowel 4 words begin with a consonant O other 'words' were found Input string: There are 12 inches in a foot. 4 words begin with a 2 words begin with a consonant 1 other 'words' were found vowel
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
Please use easy logic with proper indentations and comments for understanding!. Coding should be in C++. I am providing an
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
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
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education