Question
Write a program (copy.c) that implements the UNIX command cp. Your program will take two filenames as command-line arguments and your program should copy the
Write a program (copy.c) that implements the UNIX command cp. Your program will take two filenames as command-line arguments and your program should copy the contents of the first file to the second.
For example, copy /home/user/notes.txt /tmp/copyOfNotes.txt should copy the contents of /home/user/notes.txt to /tmp/copyOfNotes.txt. If /tmp/copyOfNotes.txt already exits, your program should delete it.
You should check the return values of all library functions and terminate your program if the source file doesnt exist, the user doesnt have sufficient priveleges to write to the destination file, etc If an error occurs, report it to the user and exit your program abnormally. See man 3 exit for more information.
2. Implement the functions prototyped in MyStack.h in a file named MyStack.c. Write a program (Student.c will have your main method for execution) that uses your stack to read student records (Student.h) from standard in and stops when a blank line is entered. Your program should then calculate and output the min, max, and average student grade.
For example,
$ Students
John 15
Tim 15
Sarah 20
Chris 10
min: 10
max: 20
average: 15
Please note that you should provide feedback to the user to let them know what is happening.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started