Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This code needs encrypt a text without changing and below that needs to be decrypted without changing the code. I also need to print each

This code needs encrypt a text without changing and below that needs to be decrypted without changing the code. I also need to print each alphabetical letter with its letter frequency.

Thanks in advance

//encryption part

#include #include

int main() { FILE* input = stdin; FILE* output = stdout; char c,k='K'; while ((c=getc(input)) != EOF) { /*Your code here*/ putc(c,output); } }

**************************************************************************************************************

decryption part

#include #include #include

void check(int argc, char* argv[]) { if (argc != 2) { puts("usage: $ ./decrypt keychar"); exit(1); } if (! isalpha(argv[1][0])) { puts("key character must be alphabetical"); exit(1); } if (argv[1][0] != toupper(argv[1][0])) { puts("key character must be upper case"); exit(1); } }

int main(int argc,char* argv[]) { check(argc,argv); char k = argv[1][0]; printf("key = %c ",k); FILE* input = stdin; FILE* output = stdout; char c; while ((c=getc(input)) != EOF) { /*YOUR CODE HERE*/ putc(c,output); } }

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

Sql All In One For Dummies 7 Books In One

Authors: Allen G Taylor ,Richard Blum

4th Edition

1394242298, 978-1394242290

More Books

Students also viewed these Databases questions

Question

c. What groups were least represented? Why do you think this is so?

Answered: 1 week ago