Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are to write a program to perform a simple encryption scheme in which each letter of a word is interchanged with another using a

image text in transcribed

You are to write a program to perform a simple encryption scheme in which each letter of a word is interchanged with another using a translation table. For each letter of a word, you are to look it up in a table and replace it with the corresponding letter. For example, given the translation table below, all 'a' letters become 'f letters, 'b' becomes 'c', etc. a b c d e f g h i j k l m n o p q r s t u v w x y z f c s a n k r p o y g u i m q v t w x j l b d e z h You program should read in the first two lines of the data file to be the translation table. The remaining data file will contain the number of words in the sentence and the sentence to be translated. For example, the data file may look like: a b c d e f g h i j k l m n o p q r s t u v w x y z f c s a n k r p o y g u i m q v t w x j l b d e z h 9 the rain in spain falls mainly on the plains 6 the man engineers the profuse danger 6 the heat accelerates the brawny change 6 the trick maps the superficial stretch 5 the structure converts the value 6 the gaudy exchange enables the snow 5 the meal assesses the note 6 the kick confers the economic person 6 the bright group studies the lift 6 the dear music advertises the woman 5 the week maps the birth The output should be the original sentence followed by its translation and in the same order as the data file. There are an unknown number of sentences of various lengths. For example, the output for the first sentence appears below. the rain in spain falls mainly on the plains jpn wfom om xvfom kfuux ifomuz qm jpn vufomx The data file is located at dmk0080/public/1040/labs/exam l/sentences. Name your program encryption.c

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

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions