Problem: Given an input file of some paragraphs, count how many times the stopwords appear. Stopwords are [A, An, The, It, There]. Create an output file for each paragraphs. Name it as "out_1.txt", "out_2.txt",... "out_n.txt" for n number of paragraphs. Paragraphs will be separated by newline We donot care about cases, so you must convert everything to lowercase. For example, if you have the following input file: CODE MUST BE IN C++ ONLY "Comprising a total area of 637.4 square miles 1,651 km, Houston is the ninth-most expansive city in the United States including consolidated city-counties. It is the largest city in the United States by total area whose government is not consolidated with a county, parish, or borough\n The cougar is a large cat native to the Americas. Its range spans from the Canadian Yukon to the southern Andes in South America and is the most widespread of any large wild terrestrial mammal in the Western Hemisphere\n Tesla is an American multinational automotive and clean energy company headquartered in Austin, Texas. Tesla designs and manufactures electric vehicles, battery energy storage from home to grid-scale, solar panels and solar roof tiles, and related products and services." CODE MUST BE C++ ONLY Output file 1 will be like- Output file 2 will be like- A: 2 An: 0 The: 4 It: 1 There : 0 A: An: The: It: There : Output file 3 will be like- A: An: The: It: There :

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

C++ Help,

I need help figuring out how to take input text from a file and splitting the string into words in order to count how many of certain words are in a file and then outputting it. I have experience with C++ and fstream but just want to learn more about this. Image is provided if anyone can send some example code of taking input from a file and splitting the provided strings into words etc. Thank you.

 

 

Problem: Given an input file of some paragraphs, count how many times the stopwords appear. Stopwords are [A, An, The, It,
There]. Create an output file for each paragraphs. Name it as "out_1.txt”, “out_2.txt”,... “out_n.txt” for n number of
paragraphs. Paragraphs will be separated by newline
We donot care about cases, so you must convert
everything to lowercase. For example, if you have the following input file:
CODE MUST BE IN C++ ONLY
"Comprising a total area of 637.4 square miles 1,651 km, Houston is the ninth-most expansive city in the United States including consolidated city-counties. It is the largest city in
the United States by total area whose government is not consolidated with a county, parish, or borough\n
The cougar is a large cat native to the Americas. Its range spans from the Canadian Yukon to the southern Andes in South America and is the most widespread of any large wild
terrestrial mammal in the Western Hemisphere\n
Tesla is an American multinational automotive and clean energy company headquartered in Austin, Texas. Tesla designs and manufactures electric vehicles, battery energy storage
from home to grid-scale, solar panels and solar roof tiles, and related products and services."
CODE MUST BE C++ ONLY
Output file 1 will be like-
Output file 2 will be like-
A: 2
An: 0
The: 4
It: 1
There : 0
A:
An:
The:
It:
There :
Output file 3 will be like-
A:
An:
The:
It:
There :
Transcribed Image Text:Problem: Given an input file of some paragraphs, count how many times the stopwords appear. Stopwords are [A, An, The, It, There]. Create an output file for each paragraphs. Name it as "out_1.txt”, “out_2.txt”,... “out_n.txt” for n number of paragraphs. Paragraphs will be separated by newline We donot care about cases, so you must convert everything to lowercase. For example, if you have the following input file: CODE MUST BE IN C++ ONLY "Comprising a total area of 637.4 square miles 1,651 km, Houston is the ninth-most expansive city in the United States including consolidated city-counties. It is the largest city in the United States by total area whose government is not consolidated with a county, parish, or borough\n The cougar is a large cat native to the Americas. Its range spans from the Canadian Yukon to the southern Andes in South America and is the most widespread of any large wild terrestrial mammal in the Western Hemisphere\n Tesla is an American multinational automotive and clean energy company headquartered in Austin, Texas. Tesla designs and manufactures electric vehicles, battery energy storage from home to grid-scale, solar panels and solar roof tiles, and related products and services." CODE MUST BE C++ ONLY Output file 1 will be like- Output file 2 will be like- A: 2 An: 0 The: 4 It: 1 There : 0 A: An: The: It: There : Output file 3 will be like- A: An: The: It: There :
Expert Solution
steps

Step by step

Solved in 5 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY