Question: Write a program in a cpp file called countVowels_LastNameFistName.cpp that reads input from a text file (sentence.txt) and outputs the number of times each lowercase

 Write a program in a cpp file calledcountVowels_LastNameFistName.cppthat reads input from

Write a program in a cpp file calledcountVowels_LastNameFistName.cppthat reads input from a text file (sentence.txt) and outputs the number of times eachlowercasevowel appears in the sentence to both thescreenandoutput_LastNameFirstName.txt.

Your program must contain the function belowcountVowelsthat return the number of times eachlowercasevowel appears in thesentence.

void countVowels(string str, int& aCt, int& eCt, int& iCt, int& oCt, int& uCt); (Noticethe return (void) and it should be the same. Also, no print statements in this function)

(Hint: that if str is a variable of type string, thenstr.at(i)returns the character at the ith position. The position of the first character is 0. Also, str.length() returns the length of the str, that is, the number of characters in str.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!