C Programming Homework #6: ROT-13

Due: Monday, March 7, 2016

Read Lesson #14 and Lesson #15 in my C tutorial.

  1. Write a filter program that transforms all characters in its input according to the ROT-13 algorithm. ROT-13 works as follows:

    1. If the character is an upper case letter, add 13 to its ASCII code, wrapping around at 'Z' if necessary. This means if the the resulting ASCII code, code, is greater than 'Z', the amount code - 'Z' - 1 should be added to 'A' to get the updated code.

    2. If the character is a lower case letter, add 13 to its ASCII code, wrapping around at 'z' if necessary.

    3. Otherwise do nothing to the character.

    Write a function rot13 that takes a character and that returns a character to perform this operation. Use rot13 in your main program.

Submit your program to Moodle (the .c file). Be sure it includes a comment block at the top that includes your name, the name of the file, the date, and a brief description of what the program does..


Last Revised: 2016-03-02
© Copyright 2016 by Peter C. Chapin <PChapin@vtc.vsc.edu>