Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here's LabTest: #include #include / / You need to create LabProj 3 . h and write the prototypes of the two functions in it #include

Here's LabTest: #include
#include
// You need to create LabProj3.h and write the prototypes of the two functions in
it
#include "LabProj3.h"
using namespace std;
// functions to test your program, DO NOT modify
void testFind(const char* targetStr, const char* subStr)
{
int res = myFind(targetStr, subStr);
if (res =0){
cout "String ""\"" subStr "\""" does not appear in string
"
"\"" targetStr "\"" endl;
}
else {
cout "String ""\"" subStr "\""" found in string "
"\"" targetStr "\""" at " res "locations" endl;
}
}
// functions to test your program, DO NOT modify
void testImproveFormat(char* targetStr)
{
cout "The string before improving the format: " targetStr endl;
improveFormat(targetStr);
cout "The string after format improvement: " targetStr endl;
cout endl;
}
int main()
{
testFind("abbbfd", "abc");
testFind("Begining","in");
testFind("MyComputer", "put");
testFind("Download","o");
testFind("friendship", "ind");
char str1[]= "Ode to Joy";
testImproveFormat(str1);
char str2[]= "Welcome to my class!";
testImproveFormat(str2);
char str3[]= "Remove the redundant blank spaces in this
string.";
testImproveFormat(str3);
}
image text in transcribed

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

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions

Question

8. Explain the contact hypothesis.

Answered: 1 week ago

Question

7. Identify four antecedents that influence intercultural contact.

Answered: 1 week ago