subject

Objectives: The purpose of this assignment is to practice dictionary usage and file reading and writing. The assignment will give you another chance to use files for input and output. Since this is the last assignment, we will keep it very simple and short. [2] Description: There are two files to read from: a codebook and a message file. The codebook will encrypt a letter with another letter. Use the codebook to encrypt the message. The codebook and the paragraph to be encrypted will be given in two separate files. You can hardwire the two input file name in the program and output the encrypted paragraph to the console. If a letter is not given in the codebook, leave it as-is in the encrypted paragraph. For example, if the codebook includes three lines below: a:e e:c c:a If the paragraph to be encrypted is "It's a nice day!". The encrypted output should be: "It's e niac dey!". The following is what the algorithm should look like in the main program. • Build the codebook (as a dict) • Print the codebook in a table form • Read the message • Print the message • Encrypt the message • Print the encrypted message [3] Requirements: Clearly, you will need to write four functions according to the algorithms above. Assume the codebook is correct, i. e, you will be able to decode the message. Decoding is NOT a requirement of this assignment. No error checking is required.
[3] Input and Output: See the sample output. The TA may test the program with a different codebook or message.
[4] Deadline: Midnight, Monday, May 3, 2021. No late assignment will be accepted for this one. code book. txt message. txt An operating system (OS) is system software that manages computer hardware, software resources and provides common services for computer programs. cid di 11 be eto hib y! try X:0 OS SIA TIP Pin tro ort ** Letter to Code d -> 1 -> 9 -> y => 1 A-> X X-> 0 ->S -> A -> P P.-> * Original message: An operating system (051 is system software that sanages computer hardware, software resources, and provides common services for computer programs. ... Encrypted message: Xp Engefosph titog (SA) st titog ttcourt oto nfphet at nuoge beweg. tt. config rotturdgt. fplntvalgt dtamtp teevadgt ett dtmnoge netheint.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:40, ihatemylife0
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
image
Computers and Technology, 23.06.2019 13:00, dimondqueen511
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
image
Computers and Technology, 23.06.2019 14:00, camiserjai1832
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
image
Computers and Technology, 23.06.2019 21:30, mariah10455
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
You know the right answer?
Objectives: The purpose of this assignment is to practice dictionary usage and file reading and writ...

Questions in other subjects:

Konu
French, 22.10.2020 08:01
Konu
Mathematics, 22.10.2020 08:01