Question: Name your source code as .cpp (replace the text with with your last name and first name, in that order) and upload to blackboard. The

 Name your source code as .cpp (replace the text with with

Name your source code as .cpp (replace the text with with your last name and first name, in that order) and upload to blackboard. The goal of this assignment is to practice functions. We will reuse the same problem from assignment 2: Write a program to read a number of words from the user until the user inputs the word "*end*". (The user may input multiple lines. Assume the max number of lines that the user will input to be 100.) Once done, read another word from the user. Let's call this word "SearchWord". The goal of the program is to find the number of occurrences of the SearchWord in the lines that the user input earlier. Your search should be case-sensitive. Assume no punctuations in the input. You should break down the above problem into functions. In your program, include a function that will take as inputs one line of the input words and the "SearchWord", and output the number of occurrences of the "SearchWord" in that line. You would call that function from the main function for each line in the input in order to compute the total number of occurrences of the "SearchWord" in all the lines. The signature of the function will look like below://Input: parameter 1 of the function is a piece of text//parameter 2 is the "SearchWord"//Output: returns the number of occurrences of the "SearchWord" in parameter 1. int countering, string)

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!