Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use C. Name: ciper.c One of the simplest types of onder med to make it harder for someone to read a message is a

image text in transcribedPlease use C. Name: ciper.c

One of the simplest types of onder med to make it harder for someone to read a message is a letter-substitution cipher, in which each letter in the original message is replaced by some different letter in the caded vomion of that massage A particularly simple type of letter substitution cipher is a cyclic cipher, in which each letter is replaced by its counterpart a fixed distance ahead in the alphabet. The word cyclic refers to the fact that if the operation of moving ahead in the alphabet would take you past Z, you simply circle back to the beginning and start over again with As an example, the following sample run shows how each leller in the alphabet is changed by shifting it ahead four places. The A becomes E, the B becomes F, the Z becomes D (because il cycles back to the beginning), and so on. This program encodes a message using a great Enter the nurie key4. Enter a message: ABCDEFGHIJKLMNOPORATUVOT Encoded message: EPGHIJKLMIOPORSTUVY To solve this problem, you should first delme a lunc lion EncodeString with the prototype sting Enoode Sting (strings, ir kayl: The functiori returns the new string formed by shifting every leller in sir forward the number of letters indicated by key cycling back to the beginning of the alphabet if necessary. After you have implemented EncodeString write a test program that duplicates the examples shown in the following sample run: am encodes a message using a cyclic cipher This program encodes a ter the numeric key: 13 ter a message: Secret message coded message: Guvt vt n Erperg zrtEntr. Note that the coding operation applies only in lattars any other character is included unchanged in the output. Moreover, the case of letters is unallected: lowercase letters come out as lowercasc, and uppercase Ictters come out as uppercasc. TA comment Uses for printing

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions