Write a program that opens an encrypted file

Assignment Help Python Programming
Reference no: EM13772270

File Encryptions and Decryption

Write a program that uses a director 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 it 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 corresponding character in the first file.

Write a second program that opens an encrypted file and display its decrypted contents on the screen.

Word Frequency

Write a program that reads the contents of a text file. The program should create a dictionary in which the keys are the individual words found in the file and the values are the number of times each word appears. For example, if the word "The" appears 128 times, the dictionary would contain an element with ‘the' as the key and 128 as the value. The program should either display the frequency of each word or create a second file containing a list of each word and its frequency.

Instructions

There are "Programming Exercises" for Chapter 9 on pages 415-418 in the course text.

Your assignment is to write programs for Exercise 3 and Exercise 5. For both exercises, use the text file namedfor_chapter9.txt. This file is provided in a zip above the drop box for this assignment.

Create a folder that identifies you and Assignment 3 such as smith_asst3 or asst3_jones. Save all Python programs to this folder. Zip the folder. No .rar files allowed. Upload the zip to the Assignment 3 drop box.

Reference no: EM13772270

Questions Cloud

Find video clips of commercials for particular product : Advertisers and marketers use information about our motivations when they create advertising campaigns. Find video clips of commercials for a particular product and identify which motivations are being targeted in the ad.
Similarities between windows 8.1 and earlier versions : Prepare a report that could be used to describe the changes and similarities between Windows 8.1 and earlier versions of Windows.
Major human activities that impact the environment : Why are consumer demand and regulation inadequate to address sustainability? What is meant by the term "regulatory capture". Provide at least one example to support your answer. Why is regulatory capture such a prevalent problem?
History and implications of child abuse and neglect : Write a 1,000- to 1,250-word paper on the history and implications of child abuse and neglect. Answer the following questions in your paper:
Write a program that opens an encrypted file : Write a second program that opens an encrypted file and display its decrypted contents on the screen.
Large mass required to have a supernova event : What would the major impact be on Earth be if the Earth remained in its present orbit and our Sun was 50% more massive than it is now?
World health organization-requirements of the energy policy : How much water does the World Health Organization suggest people need to survive? How much water does the U.S. Agency for International Development state that a person needs for a reasonably good quality of life? In the United States, what is th..
Write a summary of the fear of social media is unfounded : Write a summary of The Fear of Social Media Is Unfounded, Social Networks Enable Quick Collaboration Around Issues and Social Media Helps Students Write Better.
Supply-chain challenges in post-earthquake : What impact do you think Toyota's plan will have on the way it handles relationship management in its supply chain?

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Implements authentication using needham-schroeder protocol

Write a small project which implements authentication using Needham-Schroeder protocol. Alice connects to Bob using a trusted third party.

  Fill in the python code

Fill in the Python code to play Tic Tac Toe. I won't award points unless it runs succesfully. # Tic-Tac-Toe Game def drawBoard(board): # Draws the board using the list of numbers print(" ") print(" ",board[0]," | ",board[1]," | ", board[2]) print("--..

  Implement your algorithm in python

Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified and reinforce topic material related to the programming work cycle, and the input, processing, output program structure.

  You are tasked with improving the code for the haunted

you are tasked with improving the code for the haunted house game. please read the associated hand-out and the code

  Project title email spam filterabstractanalyze the emails

project title email spam filterabstractanalyze the emails and predict whether the mail is a spam or not a spam.to work

  Turn the turtle image into a .gif picture

How can you turn the turtle image into a .gif picture when using the built-in turtle for Python? If that's impossible how do you remove the line when you move the turtle around?

  Permutation ciphers

Permutation Ciphers (a.k.a. Transposition Ciphers) are another class of simple cryptosystems. For this we use the functions apply(.,.) and inv(.) from Homework 4; copy these two functions into your le as auxiliary functions.

  Write a program to receive a series of numbers

Write a program to receive a series of numbers (including decimal) from the user until enter key is pressed. Process the input data and display number count, sum and average. Use proper data type and format.

  Write python program isosceles tri equilateral tri rectangle

Write python program Isosceles Tri Equilateral Tri Rectangle, Write another "driver" script called project1.py which imports the polygon.py module, reads an input file of polygonal data and writes another file of areas and perimeters.

  Assume an n × n matrix a is given

Assume an n × n matrix A is given, containing only 1's and 0's, such that, in each row, all 1's come before all 0's. Give an O(n log n) algorithm to count all 1's in A.

  Tower of hanoi game

Tower of Hanoi game that you can let a player to move discs between the towers using a mouse - Each move consists of taking the upper disk from one of the pegs and sliding it onto another rod, on top of the other disks that may already be present o..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd