Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assembly Language HLA Programming Read in a STREAM of text, (multiple lines, not just one line, a stream of arbitrary length, a char at a
Assembly Language HLA Programming
Read in a STREAM of text, (multiple lines, not just one line, a stream of arbitrary length, a char at a time, and as you do so, shift each letter to lowercase, and forward in the alphabet a certain number of places. (13 places for the first cut.) Example: (shift of 13 spaces hardcoded in program, if you like.) shift Hello, Jack Uryyb, Wnpx In C, YOU'D READ THE COMMAND LINE FOR AN INTEGER IN ARGV[1] (As we said in class, START OUT by just hardcoding a shift-13. One thing at a time. Same goes for case: just drop everything to lower.) (atoi()'d convert the command line string to an integer: "1949" would become an int32 value 1949 (or $79d.) Remember that if you shift a letter off the end of the alphabet, we must "wrap around" so we come back in down by 'a'. Here's the pseudocode: read in a character c if (c is a letter ) { make c lowercase make c a number between 0 and 25 by subtracting 'a' from it. add the shift value to c, moving it forward in alphabet mod c by 26 so it's between 0 and 25 again add an 'a' to c so it's a real ASCII letter again. } print c on the output // this happens for ALL input, not just letters!
Step 2:
1. Keep track of the case of the letter before you make sure it's lower. 2. Restore the original case of the letter before you print it.
Step 3:
Remove the "hard coded" shift-13. Read the second command line parm for a one- or two-digit string, convert that string into a number and use the number to set the numper of positions to shift the output.
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