Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**Please help *** In C programming. The program will take 3 arguments (in order) - choice infile outfile If the choice is 1, implement the

image text in transcribed

**Please help

*** In C programming. The program will take 3 arguments (in order) - choice infile outfile If the choice is 1, implement the "copy" function that will read the infile, covert the content to all upper cases, and save the result to the outfile. The outfile format should be the same as the infile. If the choice is 2, implement the "sort" function that will read the infile, sort the content by decedent order (a-z), and save the first 10 characters for each line to outfile. The outfile format should be the same as the infile. If the choice is 3, implement the "wc" that will read the infile, count and display the number of words, number of lines, save the result to outfile. You need to handle the following situations and stop the program when they happen. If the number of command-line argument is not 3, print the help manual about how to run the program. If the choice is not 1, 2 or 3, print an error message "Wrong choice, the only available values are 1, 2, 3". If the infile is not found, display an error message "Error! No such file - infile" If the outfile cannot be written, display an error message "Error! Cannot save file - outfile". *** In C programming. The program will take 3 arguments (in order) - choice infile outfile If the choice is 1, implement the "copy" function that will read the infile, covert the content to all upper cases, and save the result to the outfile. The outfile format should be the same as the infile. If the choice is 2, implement the "sort" function that will read the infile, sort the content by decedent order (a-z), and save the first 10 characters for each line to outfile. The outfile format should be the same as the infile. If the choice is 3, implement the "wc" that will read the infile, count and display the number of words, number of lines, save the result to outfile. You need to handle the following situations and stop the program when they happen. If the number of command-line argument is not 3, print the help manual about how to run the program. If the choice is not 1, 2 or 3, print an error message "Wrong choice, the only available values are 1, 2, 3". If the infile is not found, display an error message "Error! No such file - infile" If the outfile cannot be written, display an error message "Error! Cannot save file - outfile

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

=+How might these stem from country and regional cultures?

Answered: 1 week ago