Question
OBJECTIVES To refresh the development of C programs by designing, implementing, and testing a solution for a simple problem. PROBLEM Design a program called producer.c
OBJECTIVES
To refresh the development of C programs by designing, implementing, and testing a solution for a simple problem.
PROBLEM
Design a program called producer.c that reads a text file (file containing ASCII characters) and encodes all characters as binary by using characters 1 and 0 to represent binary 1 and 0 respectively. Also design a program called consumer.c that will read your produced binary file and converts the contents of the binary file into a sequence of ASCII characters. Use operating system tools such as diff to check if the original and the sequence of characters generated by your consumer program are the same. If you are not familiar with the diff command you may, at the command line, type man diff. The man command returns both the syntax and the semantics of the Linux command that follows it.
TESTING
You are to use the arrangement below to test your solution. As illustrated, the file testout.txt is the encoded version of the producerTest.txt file. Your consumer program will process the testout.txt file and will create the file consumerTest.txt.
producerTest.txt producer.c testout.txt consumer.c consumerTest.txt
You are to copy the contents of the following quote from Linus Torvalds to your producerTest.txt file.
UNIX has a philosophy, it has 25 years of history behind it, and most importantly, it has a clean core. It strives for something - some kind of beauty. And that's really what struck me as a programmer. Operating systems that normal home users are used to, such as DOS and Windows, didn't have any way of life. Nobody tried to design Windows - it just grew in random directions without any kind of thought behind it. [...] I don't think Microsoft is evil in itself; I just think that they make really crappy operating systems. Linus Torvalds
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