Question: C ++ PROGRAMMING (DON'T COPY THIS @ chegg users. If anyone copies this, change it up please or ask your own question ) PART 1
C ++ PROGRAMMING
(DON'T COPY THIS @ chegg users. If anyone copies this, change it up please or ask your own question )
PART 1
a) Implement a function named startsWith which takes two string parameters str and start and returns true if str starts with start and false otherwise. e.g. santa monica, santa -> true The only string class functions you can use in your implementation are those to get string length and access its characters (no find function etc). Provide two examples of client code calling the function. b) Same as question 1 but the function is now endsWith and the second parameter is end. c) Implement a function named replaceAll which takes a string str and two characters oldChar and newChar as parameters. It replaces all occurrences of oldChar in the string with newChar. The function returns nothing. Provide an example of client code calling the function. d) Implement a function named reverse which takes a string and reverses it. The function returns nothing. Provide an example of client code calling the function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
