Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN PYHTON 3.0 In this problem, your input file will contain a number of key and ciphertext pairs, separated by a space. Each line is

IN PYHTON 3.0

In this problem, your input file will contain a number of key and ciphertext pairs, separated by a space. Each line is supposed to have one such pair. You may assume that the ciphertext contains only uppercase letters. For example the pair:

2 JGNNQ

However, it is possible that the ciphertext and even the key may be missing, and your program should handle this case.

The ciphertext has been encrypted by shifting letters in the alphabet by the amount specified by the key. The word HELLO with key = 2 becomes JGNNQ. Letters should wrap around, so PIZZA with key = 1 becomes QJAAB. If the ciphertext is missing, your program should output a message "Missing text!". The sample run below is for the inputs from secret_code.txt:

Sample Run

[evaluate codebreaker] Enter the input filename: secret_code.txt PYTHON Missing text! ALBERTA SUN Missing text! CMPUT UNIVERSITY 

The input file is not given here. You have to create your own input file with the content as described: each line has a key and ciphertext pair, separated by a space.

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions