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
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