subject
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);

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 21:00
Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from greatest to least?
Answers: 1
question
Computers and Technology, 24.06.2019 02:20
Peter is thinking of a number which isless than 50. the number has 9 factors.when he adds 4 to the number, itbecomes a multiple of 5. what is thenumber he is thinking of ?
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Need fast im timed in a paragraph of 125 words, explain at least three ways that engineers explore possible solutions in their projects.
Answers: 2
question
Computers and Technology, 24.06.2019 13:30
Does anybody know how to hack into a google account? i had important information on it and it is gone now and i need getting it back.
Answers: 1
You know the right answer?
Write a program that encrypts a message using a Caesar cipher. The user will enter the message to be...
Questions
question
Mathematics, 05.04.2021 22:40
question
Arts, 05.04.2021 22:40
question
Mathematics, 05.04.2021 22:40