Computers and Technology
Computers and Technology, 12.04.2021 20:50, svg8

Write a program that encrypts a message using a Caesar cipher. The user will enter the message to be encrypted and the shift amount (the number of positions by which letters should be shifted):Enter message to be encrypted: Go ahead, make my day. Enter shift amount (1 - 25): Encrypted message: Jr ddg, pdnh pb gdb. Notice that the program can decrypt a message if the user enters 26 minus the original key: Enter message to be encrypted: Jr ddg, pdb pdb gdb. Enter shift amount (1 - 25): 23 Encrypted message: Go ahead, make my day. You may assume that the message does not exceed 80 characters. Characters other than letters should be left unchanged. Lower-case letters remain lower-case when encrypted and uppercase letters remain upper-case. Hint: To handle the wrap-around problem, use the expression (( ch - 'A' ) n) % 26 'A' to calculate the encrypted version of an uppercase letter, where ch stores the letter and n stores the shift amount (use similar expression for lower-case as well.) We will use the following function: void encrypt(char *message, int shift);

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:30, kprincess16r
Why is it a good idea to leave an interview being courteous and polite?
Answers: 1
image
Computers and Technology, 22.06.2019 17:00, smartoa
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
image
Computers and Technology, 23.06.2019 04:20, milkshakegrande101
4. a1. vince owns a television repair shop that is insured undera commercial package policy. the policy includes thebuilding and personal property coverage form and thecauses-of-loss broad form. the declarations page indicatesthat coverage applies to both the building and the namedinsured's business property. explain whether or not thefollowing losses would be covered under his policy. a. a fire occurs on the premises, and the building isbadly damaged. b. a burglar steals some money and securities from anunlocked safe. c. a business computer is damaged by vandals whobreak into the shop after business hours. d. a tornado touches down near the store. several tel-evision sets of customers in the shop for repair aredamaged in the storm. til
Answers: 2
image
Computers and Technology, 23.06.2019 06:40, sardarp1irc5
What are the three uses of a screw?
Answers: 2
Do you know the correct answer?
Write a program that encrypts a message using a Caesar cipher. The user will enter the message to be...

Questions in other subjects: