Question: C Programming: Write a main method that 1) reads characters from the standard input stream using the standard library function getchar(). 2) Determines whether each

C Programming: Write a main method that

1) reads characters from the standard input stream using the standard library function getchar().

2) Determines whether each line encodes a valid cipher direction, key pair and data.

3) If the line contains an error, then skip to the end of the line, print an error message, and read the next line.

Each cipher record must be of the form:

Action lcg_m , lcg_c , Data
1 char 1-20 char 1 char 1-20 char 1 char any number of char 1 char

Action:

Must be either e or d, specifying encryption or decryption respectively.

lcg_m:

Specifies a 64-bit positive integer. Must be decimal digits.

lcg_c:

Specifies a 64-bit positive integer. Must be decimal digits.

Data:

Printable ASCII character data to be encrypted or decrypted. Can be empty or arbitrarily long.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!