Question: String Utilities (string utils.c) For this program you will implement the following utility functions to test mastery of C strings. *******you MUST use these and

String Utilities (string utils.c)

For this program you will implement the following utility functions to test mastery of C strings.

*******you MUST use these and ONLY these function*****

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 . 1

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.

You will find it helpful to have reference of a table of ASCII codes for this problem

String Utilities (string utils.c) For this program you will implement the following

***** OUTPUT ****

utility functions to test mastery of C strings. *******you MUST use these

MUST use the functions listed

Use FOR LOOPS

Use function from standard library header file ....such as int islower(int c); int tolower(int c); int isupper(int c); int toupper(int c);...etc....

32 20 040 : Space 64 40 100 @ 96 60 140 ` 0 0 000 NUL (null) 33 21 041 ! 65 41 101 A 97 61 141 GE97 l 001 SOH (start of heading) 34 22 042 B #98 2002 STAK (start of text) 66 42 102 98 62 142 35 23 043 #: 03 67 99 63 143 99 3 003 ETX (end of text 67 43 36 24 044 $ 68 44 104 D 100 64 144 100 4 4 004 EOT (end of transmission) 101 65 145 101 37 25 045 69 45 105 5 5 005 ENO (enquiry) 70 46 106 F: 38 26 046 38 #102 6 006 ACK (acknowledge 102 66 146 39 27 047 ' 71 47 107 l 103 67 147 103 7 7 007 BEL (bell) 40 28 050 (: 48 110 H 104 68 150 GE104: 8 8 010 BS (backspace) l 29 051 l: 73 49 111 I I 105 69 151 105; 9 011 TAB (horizontal tab A 012 LF (NL line feed, new line) 42 2A 052 * 12 & 74 106 6A 152 & 106 74 4A 1. 43 2B 053 #43: K 107 6B 153 GE107; k 75 4B 113 K l B 013 VT (vertical tab) 108 154 GE108: C 014 FF (NP form feed, new page) 44 2C 054 76 4C 114 #76 12 45 2D 055 - 77 AD 115 M M 109 6D 155 & #109: In D 015 CR (carriage return) 46 2E 056 . 78 4E 116 N 110 6E 156 & 110 14 E 016 SO (shift out) 47 2F 057 / 79 4F 117 GE79 ll 1 6F 157 lll: o 15 F 017 SI (shift in) 80 50 120 GE80; 48 30 060 0. 112 70 160 112: p 16 10 020 DLE (data link escape) 1 1: 1. 21 & 81 113 1 021 DC1 (device control l) 49 31 06 81 51 113 71 161 50 32 062 2 82 52 122 R 114 72 162 GEll4; 18 12 022 DC2 (device control 2) 51 33 063 3 3 163 GE115 #83 115 7 19 13 023 DC3 (device control 3) 83 53 123 52 34 064 4 84 54 124 84; T 116 74 164 116; 20 14 024 DC4 (device control 4) 85 55 125 U: 53 35 065 5 117 75 165 & 117 u 21 15 025 NAK (negative acknowledge) 18 76 166 GE118; 86 56 126 GE86 54 36 066 55 37 067 7: 7 27 W 119 77 167 119; W 23 17 027 ETB (end of trans. block) 87 57 1 56 38 070 8. 30 & 88 120 24 1 8 030 CAN (cance 88 58 120 78 170 57 39 071 9:9 89 59 131 Y 121 79 171 & 121: Y 25 19 031 EM (end of medium) 58 3A 072 :: 90 5A 132 122 7A 172 #122 26 IA 032 SUB (substitute) 59 3B 073 ; 123 7B 173 27 B 033 ESC (escape) 91 5B 1 33 60 3C 074 94 5E 136 30 1E 036 RS (record separator) 62 3 EL 63 3F 077 ? 95 5 137 127 7F 177 & 31 1F 037 US unit separator) Source: www Lookup Tab

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!