Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions