Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using C++ Language Note: Answers must NOT be copy-pasted from the internet. Own program source code with comments. Kindly skip if you are not sure.
Using C++ Language
Note:
- Answers must NOT be copy-pasted from the internet.
- Own program source code with comments.
- Kindly skip if you are not sure.
Deliverables:
- The program file with inline documentation in the form of comments.
- input.txt file
Instructions:
Write a program that will satisfy the following: 1. The program can read a text file named input.txt (create this on your own). This file contains the text of a news article consisting of at least 100 words. 2. The program asks the user to input a word to search for. 3. The program reads the contents of the text file and counts how many times the inputted word appears. 4. The program also determines how many sentences are there in the article which is written inside the text file. Assume that every sentence is terminated by a period. 5. the main() function should only contain variable declarations and functions calls. This means that you have to implement program functionality using user-defined functions. The program should be saved as machineproblem.cpp
Step by Step Solution
There are 3 Steps involved in it
Step: 1
include iostream include fstream include string int countWordOccurrencesstds...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started