Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please provide a C langauge code ONLY for the following #include #include #include //Returns the number of letters (alpha characters) in usrStr int getNumAlpha(const char

Please provide a C langauge code ONLY for the following

image text in transcribed

#include #include #include

//Returns the number of letters (alpha characters) in usrStr int getNumAlpha(const char usrStr[]) { /* Type your code here. */ }

//Returns character stored in replaceChar if thisChar matches thatChar, //otherwise returns character stored in thisChar char encodeChar(const char thisChar, const char thatChar, const char replaceChar) { /* Type your code here. */ }

//encodes usrStr following the replacement guidelines in the lab assignment description void encodeString(char usrStr[]) { /* Type your code here. */ }

int main(void) {

/* Type your code here. */

return 0; }

11.6 Lab Week 8: Message Encoder (1) Prompt the user to enter a string of their choosing (up to 100 characters long, which could include whitespaces). Then, output the string to the screen. (1 pt) (2) Complete the getNumAlpha0 function, which returns the number of letters in the user's string. (1 pt) (3) In main0, call the getNumAlpha0 function and then output the returned result. (1 pt) (4) Complete the encodeChar0 function, which returns the character stored in replaceChar if thisChar matches thatChar. Otherwise, the function returns the character stored in thisChar. (1 pt) (5) Complete the encodeString0 function, which should loop through the characters in usrStr making the following changes if necessary: replace any numeric digit (0-9') with #. replace the upper case letter 'O' with the number 0 . replace the upper case letter T' with the number '1 replace the upper case letter Z' with the number 2 replace the upper case letter 'E with the number 3 replace the upper case letter H' with the number'4 replace the lower case letter's' with the number 5 replace the lower case letter 'b' with the number 6 replace the upper case letter L with the number 7 replace the upper case letter 'B' with the number 8 replace the lower case letter 'g' with the number 9 All but the first replacement should be done by calling the encodeCharO function for each. (1 pt) (6) In main0, call the encodeString0 function and output the encoded string. (1 pt) Sample Input/Output: Enter a me 3 3 age : THE Answer t Life is 42 and big BIG Z003! You entered: THE Answer t Life is 42 and big BIG Zoos! Number of characters: 46 Number of letters: 30 Use the template provided. Do not change the function definitions. Simply fill in your code without changing the template Hard coding output to match test cases will automatically result in a zero on this assignment. The remaining 4 points will be for proper header, comments, variable names, and indentation (overall style)

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

=+j on to staff their operations in the global marketplace.

Answered: 1 week ago