Details of this Paper

Assignment05

Description

solution


Question

Programming Assignment 5 (125 Points);Assignment Overview;This assignment will give you some experience with dictionaries, as well as some more practice with file I/O.;Part 1: Phone keypads [50 points];The international standard letter/number mapping found on the telephone is shown below;1;2 ABC;3 DEF;4 GHI;5 JKL;6 MNO;7 PQRS;8 TUV;9 WXYZ;0;Write a function that returns a number, given an uppercase letter, as follows;def getNumber(uppercaseLetter);Write a test program that prompts the user to enter a phone number as a string. The input number may contain letters. The program translates a letter (upper- or lowercase) to a digit and leaves all other characters intact.;Here is a sample run of the program: Enter a string: 1-800-Flowers;1-800-3569377 Enter a string: 1800flowers;18003569377;Part 2: File Encryption and Decryption [75 points];Write a program that uses a dictionary to assign ?codes? to each letter of the alphabet.;For example;codes = { ' A': ' %', ' a': ' 9', ' B': ' @', ' b': ' #', etc...};Using this example, the letter A would be assigned the symbol %, the letter a would be assigned the number 9, the letter B would be assigned the symbol @, and so forth.;The program should open a specified text file, read its contents, and then use the dictionary to write an encrypted version of the file?s contents to a second file. Each character in the second file should contain the code for the corresponding character in the first file.;Submission;1. Include the standard program header at the top of your Python file.;2. Submit your files to Etudes under the ?Assignment 5? category.;Phone keypads.py;Encryption.py;Standard program header;Each programming assignment should have the following header, with italicized text appropriately replaced.;Note: You can copy and paste the comment lines shown here to the top of your assignment each time. You will need to make the appropriate changes for each assignment (assignment number, due date, and description).;';* Program or Lab #: Insert assignment name;* Programmer: Insert your name;* Due: Insert due date;* CS21A, Summer 2014;* Description: (Give a brief description for Assignment 5) '';Write a second program that opens an encrypted file and displays its decrypted contents on the screen.

 

Paper#67138 | Written in 18-Jul-2015

Price : $41
SiteLock