Question: Hello, I am in an intro C language programming class and I have this problem assignment. I am completely stumped. Thank you. String Utilities (string
Hello,
I am in an intro C language programming class and I have this problem assignment. I am completely stumped.
Thank you.
String Utilities (string utils.c) For this program you will implement the following utility functions to test your mastery of C strings.
void removeBlanks(char *src, char *dest);
void replaceChar(char *src, char oldChar, char newChar);
char *flipCase(const char *src);
Please read the description of these functions carefully. In the removeBlanks function you will implement a routine that takes a string in as src and outputs the same string into dest but removing any blank space character encountered. For example, if the src is Hel lo Wor ld!, this function should return the value HelloWorld! via the dest pointer .
In the replaceChar function your function should operate much like a find and replace operation in a word processor works, meaning that the function will replace any instance of the character oldChar and replace it with the character newChar. For example, for a src string Hel lo Wor ld, if oldChar is o and newChar is e, then src is modified as Hel le Were ld!.
In the flipCase function the function turns each lowercase character into an uppercase character and each uppercase character into a lowercase character. For example, if the src string is GNU Image Processing Tool-Kit, then this function should return a string gnu iMAGE pROCESSING tOOL-kIT.
In your main function, you should prompt the user for a string to use for the first two functions, and a string to use for the third function. The user should be allowed to enter any string including ones with white spaces as input. You should also prompt the user for a character to replace and a replacement character for the flip case function. You may assume that any input string will be at maximum 100 characters.
NOTE:
Functions must match all calls and variables from above perfectly.
The third function must have a seperate input string.
I have included a program demo below for help.
Thank you.
Enter string for remove blanks and replace char function functions: Hello Wor ld! Enter string for flip case function GNU Image Processing Tool-Kit Enter character to replace Enter replacement character 1. remove Blanks Remove all blanks in Hel lo Wor ld! ls: Hello World 2. replace Char Remove all 'o's in Hel lo wor ld! with 'e' s is: Hel le Wer ld! 3 flip Case Original string is GNU Image Processing Tool-Kit Flipped case string is gnu iMAGE pROCESSING tOOL-k IT
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
