CPS 125 Alexander Ferworn LAB 3 Purpose: This lab is designed to introduce you to programming in the C language. Given a problem statement, you will design and use the emacs editor to study and modify a C program. 1. Copy the program lab3.murphy.c from the course lab 3 directory, /home/t4a/cps125aa/lab3 2. Look at the program with cat 3. Compile, link, and execute the program 4. Note any errors produced as the changes listed below are made with emacs. The goal of the lab is to understand what is happening and why any errors occur. [Hint: To help identify errors generated during compilation, it may prove useful to use cc -qsource murphy.c, followed by the use of cat, more, or emacs to see the "listing file" murphy.lst (generated by the -qsource flag). To ensure that you are looking at the listing produced by your latest compile, note the time the compile is performed with the UNIX command date; type ls -al to compare this with the time the .lst file was created] To see the compiler messages in each case, make only a single change at a time, repairing it prior to trying the next case (compile and re-run to check your correction): a. Remove the leading /* b. Remove the trailing */ c. Omit the semicolon from the end of the second printf d. Remove ) from main() e. Remove ( from main() f. Remove () from main() g. Misspell printf h. Drop the () from printf() i. Omit the closing brace at the end of the program j. Omit the # sign from the #include directive k. Omit #include <stdio.h> l. Add/delete spaces within the " ", especially at the start and end of lines m. Insert a blank between \ and n of one newline escape sequence n. Omit an opening " on one line o. Omit a closing " on one line p. Replace ' with " in O'Toole's q. Replace the : with ; on one line r. Replace the : with x on one line s. Add a blank line before the 3rd printf statement t. Replace one printf with print u. Replace a \n sequence by \t, \a, \b, \f, \r, \\ v. Replace two \n sequences by \ w. Redirect the standard output to the file lab3.out; type ls -al and then cat or more the new output file x. Add several other changes, and try to understand their effects