
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
Please use easy logic with proper indentations and comments for understanding!. Coding should be in C++. I am providing an

Transcribed Image Text: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

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 nowThis is a popular solution!
Step by stepSolved 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
- I am currently coding in C++, using Dev C++ application. I keep getting the error " 'null' was not declared in this scope." The line of code that it is refrencing is " std::srand(std::time(null));". I have no idea what is happening or how to fix it.arrow_forwardPlease use easy logic with proper indentations and comments for understanding!. Coding should be in C++. I am providing an algorithm that you will need to answer this coding question. I am also providing this solved program but it's not printing each line separately as it supposed to (Output is given in the picture). The file has 3 separate sentences on 3 lines. Our program supposed to print three separate lines as exactly shown in the sample output. Please review my code and provide a correction to it. Thank you 1 2 3 #include <iostream> 4 #include <fstream>5 #include <cstdlib>6 7 using namespace std; 8 9 void status(string st,int &vowel,int &consonant, int &other)10 {11 12 //if it is vowel13 if ((st[0]=='a' || st[0] == 'e' || st[0] == 'i' || st[0] == 'o' || st[0]=='u') || (st[0]=='A' || st[0] == 'E' || st[0] == 'I' || st[0] == 'O' || st[0]=='U') )14 vowel++; //incrementing vowels by 115 else if(isalpha(st[0]))16 consonant++;…arrow_forwardYou must use an STL container (such as list or vector) for this assignment; solutions not using an STL container are not acceptable. Write a C++ program to get up to ten integers from the user, store them in an STL container, and then calculate and display: (1) the mean (2) the variance of the population (see https://www.statisticshowto.com/population-variance/ for the formula and an example) (3) the standard deviation (the square root of the variance)arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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