Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Closing Date 9 Dec 5pm Description One of the most famous and simple forms of cryptography is the Caesar Cipher. This Cipher works by shifting

Closing Date 9 Dec 5pm

Description

One of the most famous and simple forms of cryptography is the Caesar Cipher. This Cipher works by shifting each letter a number of letters forward. For example, a shift of 3 on the letter "a" would give "d". If the shift takes you past the end of the alphabet, just rotate back to the front of the alphabet. For example, a shift of 3 on the letter "y" would give "b".

Your task is to make a program which accepts both a String and an int. The String is the message to be encrypted, and the int repesents the number that will be used for shifting.

For example: the String "Hello" and shift of 2 would go like this:

  • H -> J
  • e -> g
  • l -> n
  • l -> n
  • o -> q

this gives us the final answer of "Jgnnq" which should be printed. Sample Input 1

 Hello World 5 

Sample Output 1

 Mjqqt Btwqi 

Sample Input 2

 Et Tu Brute 21 

Sample Output 2

 Zo Op Wmpoz 

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

Students also viewed these Programming questions