Question: readcmd.c (5 Points). Compile and run the program found in reademd.c. This program accepts single letter commands as input and simply prints out the command
(5 Points). Compile and run the program found in reademd.c. This program accepts single letter commands as input and simply prints out the command it read. Any blanks in front of the command are ignored, as are any characters after the command. You should type in input lines like the following to see how it behaves: and this is a long line One of the things you will notice about this program is that it is not documented with comments for the algorithm or for the functions. Your first task is to document this code. Copy the program into myreademd.c, and extend this file to ignores leading tabs as well as leading blanks (or any combinations of blanks and tabs). Now extend the program to have either a semi-colon or a newline character indicate the end of a command. Here's a sample run: The command is: a The command is: b The command is: a Now extend the program to verify that the command is an upper or lower case leter It should print an eror message irit isn't. Also, verify that the line has a command: if it hits a blank or : without an intervening command, you should print an error. Here's a sample run
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
