Question: Create a C program that accepts command line tokens. Parse the tokens and have the program respond as follows: 1 . Print out the number

Create a C program that accepts command line tokens. Parse the tokens and have the program respond as follows:
1. Print out the number of tokens entered and then print each token read from the command line.
2. If the token -i is captured the next token is a file name for input. Try to open the file and print out success or an error message.
3. If the token -o is captured the next token is a file name for output. Try to open the file and print out success or an error message.
4. If the token -h is captured then print out a help message that shows all valid tokens with their purpose.
5. If the token -a is captured then use ascending order for numbers and letters.
6. If the token -d is captured then use descending order for numbers and letters.
7. Make an input file with a random combination of single numbers (0-9) and single letters (uppercase and lower case). Minimum of 8 total characters. Maximum of 12 total characters.
8. If the input file exists when running the program and you can open it then print its contents.
9. If the output file exists and you can open it then overwrite its contents with a sorted version of the data from the input file. And if the letters of the input file are lower case make them upper case letters. If the letters of the input file are upper case make them lower case.
10. Your final code file should follow these style requirements:
a. Include File header and Function header comments in the c file
b. Arrange the code to eliminate function prototypes.

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 Programming Questions!