Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assignment will focus on reading and writing files, man pages, and conditional compilation to turn on various teatures.Task 1 : Implement a version of

This assignment will focus on reading and writing files, man pages, and conditional compilation to turn on various teatures.Task 1: Implement a version of the program that we wrote in class. The program should act as a "filter" program, taking in no command line arguments, but reading in any file that we redirect to it on the comment line. For example, you should be able to write:/al file.txtand it will read in file.txt, character by character. All this code needs to do is output the file to the screen without modifying anything.Task 2: Use conditional compilation to implement a version of the code in Task 1 that will output a "switched case" version of this file. All uppercase letters should be switched to lowercase, and all lowercase letters should be switched to uppercase. If everything works correctly, you should be able to run the following:/al input.txt output.txtand your output should end up in output.txt. You should compile this version of the code using the target"switched" in vour Makefile.Task 3: Use conditional compilation to implement a version of the code in Task 2 that doesn't write the switched case output to the screen, but instead writes it to a temp file. I then want you to read the temp file backwards and display the file to the screen backwards (i.e., in reverse order). This will involve using the man pages, and looking into fseek, SEEK_END, SEEK_CUR, etc. You might also want to look at the man page for toupper() for Task 2, as that will probably help you with determining if a letter is uppercase or not. You should be able to compile this version of the code using a Makefile with the target "reversed".Deliverables: Your deliverable for this assignment are:A single .tgz file containing:a single Makefile with multiple different targets for various conditional compilation situations.one source code file that can be compiled to run either Task 1, Task 2, or Task 3 using different conditional compilation conditions / macro definitions in the Makefile and source code.a "code diary" documenting your approach to the code and your coding process.

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_2

Step: 3

blur-text-image_3

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

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago