Write a C++ program as per the following instructions:
(i) Write a C++ code which reads the contents of a text file “first_file.txt”
(ii) Write a function named vowel_words() which will segregate the words starting with vowels
from the “first_file.txt”
(iii) Write a C++ code which writes the resultant words to the output file, “second_file.txt”.
Example: Content of first_file – “I am going to buy an umbrella”
Output in second_file.txt – I am an umbrella
1
Expert's answer
2015-08-03T03:51:59-0400
#include <iostream> #include <string> #include <fstream> using namespace std;
void segregateWords(string str);
void main() { ifstream inFile; string words;
inFile.open("first_file.txt");
while (inFile >> words) { segregateWords(words); }//end while loop
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment