Question: Here is the starter code: /* Returns 1 if the argument is a decimal digit (such as '5'), 0 otherwise */ int is_digit(char character) {

 Here is the starter code: /* Returns 1 if the argument

Here is the starter code:

/* Returns 1 if the argument is a decimal digit (such as '5'), 0 otherwise */ int is_digit(char character) { /* WRITE THIS FUNCTION */ return -1; }

/* Converts uppercase letters to lowercase letters. * If the argument is an uppercase letter, the function returns the * corresponding lowercase letter (e.g., 'D' yields 'd'). Otherwise, the * function returns the argument, unchanged. */ char to_lowercase(char character) { /* WRITE THIS FUNCTION */ return '\0'; }

2 Treating Characters as Numbers Archie replies to your email, assuring you that a new keyboard has been ordered. Meanwhile, he needs you to write some code that will convert uppercase letters to lowercase letters and to indicate whether or not a character is a decimal digit. You realize this is easy work since those actual functions are part of the standard C library with their prototypes in ctype.h. As you get ready to impress your boss with how fast you can write this code by calling those standard functions, the 3 key (which is also used for #) falls off of your keyboard, preventing you from typing #include . Several other number keys fall off soon thereafter (only 0,7, and 9 remain), along with the s key. The f key is looking fragile, so you decide that you had better not type too many if statements (and without the s key, you can't use a switch statement at all). Edit problem2.c so that is_digit() returns 1 if the character is a decimal digit ('0', '1', '2', ...) and 0 otherwise to_lowercase () will return the lowercase version of an uppercase letter ('A', 'B', 'C', ...) but will return the original character if it is not an uppercase letter You may not #include any headers, you may not use any number keys other than the 0, 9, and 7 (which is also used for &) keys, you may not use switch statements, and you may use at most one if statement in each function. Build the executable with the command: make bitslab2-be sure to fix both errors and warnings

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!