Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please can you help me with this C++ programing question? Write a word search and word count program. 1)Assign the following text to a string

Please can you help me with this C++ programing question?

Write a word search and word count program.

1)Assign the following text to a string constant.

For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life. For God did not send his Son into the world to condemn the world, but to save the world through him. Whoever believes in him is not condemned, but whoever does not believe stands condemned already because they have not believed in the name of God's one and only Son. This is the verdict: Light has come into the world, but people loved darkness instead of light because their deeds were evil. Everyone who does evil hates the light, and will not come into the light for fear that their deeds will be exposed. 21But whoever lives by the truth comes into the light, so that it may be seen plainly that what they have done has been done in the sight of God.

2)Using C++, prompt the user to enter a word or phrase

3)Search the string given by the user from the text above and inform how many times the word/phrase was found in the text.

(Hint: You need to use while loop, .find and .length function from string library. Also, you will need to use string::npos.)

4)Search for the following (ALL strings are CASE-SENSITIVE!)

a.God

b.the world

c.believe

d.Jesus

e.only Son

f.life

4) Screenshots your program's output using the six test cases above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions