Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python 3.6 Requriements Submit only the files requested Print all floats to 2 decimal points unless stated otherwise Descripition For this problem you will be

python 3.6

Requriements

Submit only the files requested

Print all floats to 2 decimal points unless stated otherwise

Descripition

For this problem you will be implementing a Caesarin Cipher. A Caesarin Cipher takes a string and a shift amount and shift the characters in the string by the shift amount.

Specifications

Only characters should be ciphered

If a character is shifted beyond the end of the aphabet it should wrap back around

For example if the letter 'y' is shifted 3 it will become 'b'

You will find the functions chr and ord very helpful for this assignmentord takes in a single character and gives back its ascii value

ord('a') is 97

ord('B') is 66

chr takes an integer number and gives back the character it represents

chr(97) is 'a'

chr('B') is 66

Combining these ideas together

chr(ord('a') + 2) is 'c'

chr(ord('B') + 3) is 'E'

Assumptions

Input will not always be valid

If invalid input is received your program should continue to ask for more input until a valid value is entered

While input may be invalid it will always be of the correct type

Valid Input

Shift amount: a value between 0 and 25

String to be ciphered: any string is valid

Example 1

Please enter a string to be ciphered: abcXYZ Please enter a shift amount between 0 and 25: 1 bcdYZA

Example 2

Please enter a string to be ciphered: ABCxyz 123

Please enter a shift amount between 0 and 25: 3 DEFabc 123

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 Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions