Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are required to write two overloaded functions called NestedStatements that take in the following formal parameters list: Function 1: takes as input two strings

You are required to write two overloaded functions called NestedStatements that take in the following formal parameters list:

Function 1: takes as input two strings (i.e. S1 and S2) and returns true if the string S1 appears in the string S2 at least once. Otherwise, the function returns false. For example, if S1 = "eat" and S2 = "the weather is nice" then the function returns TRUE. Similarly, if S1 = "zoo" and S2 = "the zoo is closed" then the function also returns TRUE.

Function 2: takes as input two strings (i.e. S1 and S2) and an integer reference variable count, and saves the number of times the string S1 appears in the string S2 in the variable count. For example, if S1 = "the" and S2 = "the weather is nice" then the value of count at the end of the function is 2. Similarly, if S1 = "cloned" and S2 = "the zoo is closed" then the value of count at the end of the function is 0.

Do not write and submit the main subroutine, or any include statments, these are already written and hidden from you. However, if you want to test your solution in any IDE (e.g., CodeBlocks, CLion, onlinegdb.com), then you will need to write your own main there for testing purposes.

IMPORTANT NOTES

Do not change the given functions headers.

Do not add any cout statements inside the functions.

Assume all the alphabetical characters in S1 and S2 are lowercase.

Please include function 1 and function 2 separately & then include all of the code for testing purposes.

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

Step: 3

blur-text-image

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

Advances In Databases And Information Systems Second East European Symposium Adbis 98 Poznan Poland September 1998 Proceedings Lncs 1475

Authors: Witold Litwin ,Tadeusz Morzy ,Gottfried Vossen

1st Edition

3540649247, 978-3540649243

More Books

Students also viewed these Databases questions

Question

6. How do histories influence the process of identity formation?

Answered: 1 week ago