Question: C++ CODE (NO STRINGS and string libraries allowed(USE CHARACTER ARRAYS ))) Function Prototype TO USE: char* removeSentence(char* Para, char* input); 1) Given a paragraph as
C++ CODE (NO STRINGS and string libraries allowed(USE CHARACTER ARRAYS )))
Function Prototype TO USE: char* removeSentence(char* Para, char* input);
1) Given a paragraph as a character array, write a c++ program to remove a substring from that paragraph. Your function should return the original array after removing the input array
GOOGLETESTCASE.
must pass these cases
TEST(RemoveSentence,Test1) { char* Para = "Helpdesk: There is an icon on your computer labeled My Computer. Double click on it. User: What's your computer doing on mine?"; char* input = "Double click on it."; char* output = "Helpdesk: There is an icon on your computer labeled My Computer. User: What's your computer doing on mine?"; ASSERT_EQ(0,strcmp(output, removeSentence(Para, input))); }
TEST(RemoveSentence,Test2) { char* Para = "A son asked his father (a programmer) why the sun rises in the east, and sets in the west. His response? It works, dont touch!"; char* input = "(a programmer)"; char* output = "A son asked his father why the sun rises in the east, and sets in the west. His response? It works, dont touch!"; ASSERT_EQ(0,strcmp(output, removeSentence(Para, input))); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
