Question: Exercise 1 Enter (yes, retype it yourself) the anagram programs from section 2.8 of Programming Pearls . Reformat the code from both programs to apply
Exercise 1
Enter (yes, retype it yourself) the anagram programs from section 2.8 of Programming Pearls. Reformat the code from both programs to apply proper indentation.
Also note that you will need to #include the standard C libraries to make the programs compile:
- The sign program needs: stdio.h, string.h, and stdlib.h.
- The squash program needs: stdio.h, and string.h.
A line needs to be copied from the sign program to squash, too. Use compiler error messages to help you figure out whats missing.
Run the program using pipes) (|), as described in the book. Apply the programs that youve written to:
- A small list of words that you enter, by hand, yourself. (That is, make a file called mywords.txt using your text editor)
- The file words.txt.
- The file /usr/share/dict/words (already on the system).
Redirect the output of each to three separate files: output1.txt, output2.txt, and output3.txt, and view the contents of those files.
Completion
To earn complete marks for this lab, you must be able to demonstrate the following actions to the lab TA:
- Log into the macOS system using your user ID.
- Open a terminal window.
- Run your programs from exercise 1 in the terminal, using pipes and redirection.
- View output3.txt in the terminal window, using a UNIX program that will let you view or edit one screenful at a time.
- Log out (without shutting down the computer! Other people may be using your machine, too!).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
