Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS 3A Winter 2018 PYTHON Assignment #9 March 5, 2018 Programming Assignment 9 (50 points) Due date: March 14th, 2018 at 11:59 PM Overview This

image text in transcribed
image text in transcribed
CS 3A Winter 2018 PYTHON Assignment #9 March 5, 2018 Programming Assignment 9 (50 points) Due date: March 14th, 2018 at 11:59 PM Overview This assignment provides practice with dictionaries in Python. Part 1: File Encryption and Decryption [25 points] Write a program that uses a dictionary to assign "codes" to each letter of the alphabet. Using this example, the letter A would be assigned the symbol ), the letter a would be assigned the number 0, 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. Write a second program that opens an encrypted file and displays its decrypted contents on the screen. Use functions for structure and to avoid redundancy. To receive full credit, you should: Write a function that asks the user for a file name, opens the file, and converts its content using the CODE above. It then returns a string of the converted text. Write a function that gets a string of the converted text, opens an output file, and writes to the file. Write a function that gets a string of the converted text and writes converted text to the screen . Hint: Encryption and decryption are inverse of one another. Name the source code files "Encryption.py" and "Decryption.py" Sample run part 1: Enter the name of the input file: data.txt Enter the name of the output file: encypted txt Sample run part 2: Enter the name of the input file: enerypted. txt No one is unavare of the nane of that famous English shipowner, Cunard. In 1840 this shrewd indus featuring three wooden ships with 400-horsepower paddle wheels and a burden of 1,162 metric tons. Eight years later, the company's assets vere increased by four 650-horsepower ships at 1,820 metric tons, and in two tonnage In 1853 the Cuna added to its assets the Arabia, the Persia, the China, Russia, al1 ships of top trialist founded a postal service between Liverpool and Halifax, more years, by two other vessels of still greater power and rd Co., whose mail-carrying charter had just been reneved, successively the scotia, the Java, and the speed and, after the Great Eastern, the biggest ever to plow the So in 1867 this company owned twelve ships, eight with paddle wheels propellers If I give these highly condensed details, it inpor and four with is so everyone can fully understand the tance of this maritime transportation company, known t he worid over for its shrewd lo transoceanic navigational undertaking has been conducted with more ability, no business dealings have been crowned with greater success

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions