Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Use vi to create a C program source file caesarcipher.c 2.(1 Point) The program should include a comment section at the beginning that describes

image text in transcribed

1. Use vi to create a C program source file caesarcipher.c 2.(1 Point) The program should include a comment section at the beginning that describes its purpose (couple of lines), the author your name), your department, a small "history section indicating what changes you did on what date. The code should be properly indented for readability as well as contain any additional comments required to understand the program logic. 3.(1 Point) The source code should be compilable by (exactly) using the command gcc -o caesarcipher caesarcipher.c. 4.(2 Points) Your program should accept an integer argument as its option for the user to indicate the offset. If the user does not pass this argument, you should display an error message and terminate with error code 1. $ ./ caesarcipher Error: usage is caesarcipher $ echo $? 5.(4 Points) Your program should use the offset to shift the letters typed in a line either to the right. $ ./caesarcipher 5 this is a secret message ymnx nx f xjhwjy rjxxflj or to the left. $ ./caesarcipher -5 this is a secret message ocdn dn v nzxmzo hznnvbz 6.(2 Points) The program should be able to read multiple lines, encrypting and displaying one line at a time, till it runs out of input/reaches EOF (can be simulated by pressing CTRL+D at the keyboard input in an empty line). If you are using the tester script, you shouldn't have to do CTRL+D (if you do, there is an issue with your implementation). The program should terminate with return code o for any sucessfull execution. $ ./caesarcipher 5 this is a secret message ymnx nx f xjhwjy rjxxflj delete after reading ijqjyj fkyjw wjfinsl $ echo $? 7.(1 Point) The program should only encrypt lowercase english alphabets (a-z) and should merely print any other letters, numbers, white space characters, etc., as is. $ ./caesarcipher 6 Hello there! How is COMP206? Hkrru znkxk! Huc oy COMP206

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

Students also viewed these Databases questions

Question

How can you defend against SQL injection attacks?

Answered: 1 week ago