Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A Caesar cipher is a simple way of obscuring words by shifting each letter in a word by a set amount . For example, when

A Caesar cipher is a simple way of obscuring words by shifting each letter in a word by a set amount
. For example, when the shift is =3
, the letter 'A' becomes 'D' and the letter 'B' becomes 'E'. Letters near the end of the alphabet "wrap-around", so that 'Z' becomes 'C' on a shift of 3.
Write a void function char_caesar that accepts a single char by reference (representing either a lower-case or an upper-case ASCII letter) as well as a single int shift amount of 0 to 25, and then modifies the char by shifting it by the given amount.
Provide a comment before your declaration of char_caesar with a purpose statement in the same format from the course notes. The lab instructors will check for the purpose statement and it needs to be correct and clearly written in order to be marked correct. Don't forget to include any requirements on the arguments.
In your main function scan for a character c (an upper-case or lower-case alphabetical character) and an integer n (from 0 to 25) and then use char_caesar to apply a shift of n to character c. Finally, print the updated value of c followed by a newline character.
Note. You can assume all input follows the given specification.

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

What are the four main types of reports required of a single audit?

Answered: 1 week ago