Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

There are many ways to encrypt data so that it cannot be read by others. One very simple (and very weak) form of encryption is

There are many ways to "encrypt" data so that it cannot be read by others. One very simple (and very weak) form of encryption is ROT13. This idea is to replace each letter in the message by the letter that is 13 places further down in the alphabet. For example, 'A' is replaced by 'N', 'B' is replaced by 'O', etc. This process "wraps around" back to the front of the alphabet is needed, so 'M' is replaced by 'Z' and 'N' is replaced by 'A', and 'O' if replaced by 'B', etc. ROT is shorthand for "rotate". Let c be a character variable: char c = some-upper-case-letter-here; Write an expression that will assign to c its new value under the ROT13 encryption scheme. That is, you should fill in the right-hand-side of the code below: char rotated_c = ... some arithmetic expression here ...; Recall that we saw that we can do arithmetic with character data. HINT: it is helpful to use the modulo (%) operator. You can write a small program to test your code. You should not use a loop to solve this problem (that is overkill).

This is programming language 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

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 Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions