CSC 241 DePaul University Intro to CS The Cesar Cyber Python Coding Project

User Generated

zf16

Programming

CSC 241

DePaul University

CSC

Description

Hello, I'm attaching a PDF with all the instructions for this assignment.

Please remember this will be very simple entry level python coding.

Nothing too advanced.

Unformatted Attachment Preview

CSC 241 Introduction to Computer Science Programming Project 4 GENERAL INSTRUCTIONS: Assignments are intended as INDIVIDUAL challenges. You are required to work on assignment ON YOUR OWN. Assignments are always due by Lab time. They must be submitted via D2L Submissions. (80 points) This week challenge is to implement a program that encrypts and decrypts text using the Cesar cypher PROBLEM STATEMENT: The Cesar cypher is one of the simplest methods of encryption, anecdotally used by Julius Cesar to protect his own private correspondence. It is a simple substitution cipher in which each letter in the original text is replaced by a letter some fixed number of positions down the English standard alphabet. For example, with a shift of 3, A would be replaced by D, B would become E, and so on. (Wikepedia, http://en.wikipedia.org/wiki/Caesar_cipher ). We want to create a program that can take an English text file and encrypt it using a specified Cesar cypher or a Cesar encrypted file and decrypt it using the specified Cesar cypher. DETAILED INSTRUCTIONS 1. Write a function called cesar that: i. Takes four parameters as inputs: 1. two strings that will be, respectively, the paths of the input file and the output file, 2. two integers. a. The first integer is the desired shift in the alphabet to be used (3 in the example above). You must allow for this integer to be any integer at all. If an integer greater than 25 is entered than you must go back to the beginning of the alphabet and keep counting. For example if this parameter is 26 then no shift will be performed as if 0 were entered, if this parameter is 28 then a will be replaced with c, as if 2 were entered. Hint: remember the remainder operator? b. The second integer is the “mode” in which the function needs to operate. 0 entered as value for this parameter indicates that the function must ENCRYPT a plain text file into a cesar-cyphered one. 1 entered for this parameter indicates that the function must DECRYPT a cesar-encrypted file and create a plain English readable file. ii. Counts the number of lines, the number of words, and the number of characters of the input file. For the purpose of this assignment a “word” is anything between two spaces. Do not worry about punctuation marks; iii. If the mode is 0 (encrypt), generates a cesar encrypted output file using the provided cypher value; iv. If the mode is 1 (decrypt), generates a plain English version of the input file in the output file; v. Lower and Upper cases MUST be respected in the encryption/decryption process. lower cases  lower cases and UPPER cases  UPPER cases. vi. YOU MUST OPEN THE INPUT FILE ONLY ONCE IN YOUR FUNCTION; vii. Do not forget to close your files. viii. A function can return more than one result at a time. If I need to return x,y,and z I can use return(x,y,z). Your function must return the number of lines, number of words, number of characters of the input file. 2. In the same file where you wrote the function in 1 above, write code that does the following: 1. 2. 3. 4. Asks the user for the path of the input file; Asks the user for the path of the output file; Asks the user for the cypher to be used; Asks the user for the mode (something like: ‘Are you encrypting or decrypting a file? Please enter 0 for encryption services or 1 for decryption services”); Assume for this assignment that the user will indeed enter 0 or 1 (you do not need to check) 5. Calls the cesar function for the parameters entered by the user; 6. Prints out for the user the information on the number of lines, words, and characters of the input file; Notice that if your function returns more than one piece of data, say three pieces of data that you want to store in variables a,b, and c, you can use the following line of code: a,b,c = nameOfYourFunction(necessary parameters for your function) 7. Tells the user that the encrypted or decrypted file is available at – path of the output file.
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hi again :), I've just fin...

Related Tags