Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 8, Problem 11PP
Program Plan Intro
Decryption of the intercepted message
Program plan:
- Include necessary header files.
- Declare the namespace.
- Declare the function “decrypt()”.
- Define the function “decrypt()”.
- Declare the necessary variables.
- Use “for” loop to iterate the string length using the function “strlen()”.
- Encode the string and assign the result into the variable “Encrypt”.
- The “if” loop check the condition.
- True, use the formula to decrypt the message.
- Otherwise, use the formula to decrypt the message.
- Assign the decrypted message into the variable “decode[i]”.
- Define the “main()” function.
- Declare and initialize the necessary variables.
- Use “for” loop to iterate the number or key between “1” to “100”.
- Call the function “decrypt()”.
- Print the result.
- Return “0”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Need solution asap try to keep it simple and easy
Please do not give solution in image format thanku
Python Code on a Linux Computer
Python Jupyter Notebook
Chapter 8 Solutions
Problem Solving with C++ (10th Edition)
Ch. 8.1 - Prob. 1STECh. 8.1 - What C string will be stored in singingString...Ch. 8.1 - What (if anything) is wrong with the following...Ch. 8.1 - Suppose the function strlen (which returns the...Ch. 8.1 - Prob. 5STECh. 8.1 - How many characters are in each of the following...Ch. 8.1 - Prob. 7STECh. 8.1 - Given the following declaration and initialization...Ch. 8.1 - Given the declaration of a C-string variable,...Ch. 8.1 - Write code using a library function to copy the...
Ch. 8.1 - What string will be output when this code is run?...Ch. 8.1 - Prob. 12STECh. 8.1 - Consider the following code (and assume it is...Ch. 8.1 - Consider the following code (and assume it is...Ch. 8.2 - Consider the following code (and assume that it is...Ch. 8.2 - Prob. 16STECh. 8.2 - Consider the following code: string s1, s2...Ch. 8.2 - What is the output produced by the following code?...Ch. 8.3 - Is the following program legal? If so, what is the...Ch. 8.3 - What is the difference between the size and the...Ch. 8 - Create a C-string variable that contains a name,...Ch. 8 - Prob. 2PCh. 8 - Write a program that inputs a first and last name,...Ch. 8 - Write a function named firstLast2 that takes as...Ch. 8 - Write a function named swapFrontBack that takes as...Ch. 8 - Prob. 6PCh. 8 - Write a program that inputs two string variables,...Ch. 8 - Solution to Programming Project 8.1 Write a...Ch. 8 - Write a program that will read in a line of text...Ch. 8 - Give the function definition for the function with...Ch. 8 - Write a program that reads a persons name in the...Ch. 8 - Write a program that reads in a line of text and...Ch. 8 - Write a program that reads in a line of text and...Ch. 8 - Write a program that can be used to train the user...Ch. 8 - Write a sorting function that is similar to...Ch. 8 - Redo Programming Project 6 from Chapter 7, but...Ch. 8 - Redo Programming Project 5 from Chapter 7, but...Ch. 8 - Prob. 11PPCh. 8 - Write a program that inputs a time from the...Ch. 8 - Solution to Programming Project 8.14 Given the...Ch. 8 - Write a function that determines if two strings...Ch. 8 - Write a program that inputs two strings (either...Ch. 8 - Write a program that manages a list of up to 10...
Knowledge Booster
Similar questions
- Programming language: Dr. Racket Write a function encode that consumes a string message. The function produces a string which is encrypted according the following procedure: Only the letters from the original message will be encrypted. Other characters such as spaces, punctuation, numeric digits, etc. are not included in the encrypted message at all. The encrypted message will only contain uppercase letters. Each letter will be replaced by the uppercase letter at the opposite end of the English alphabet.In other words, A or a will become Z, B or b will become Y, C or c will become X, ..., Z or z will become A. The encrypted message will have a single space separating each letter. You may assume that the letters in message are English letters only. For example: > (encode "Cat") "X Z G" > (encode "Is this correct?") "R H G S R H X L I I V X G"arrow_forwardOne of your colleagues wanted to generate an List of strings using a random function, and since you are an expert in programming, your colleague asked you to create a program for him that generates random letters to make this desired string (I am a programmer) how can you help him to achieve this task ? Notes: string length must be lesser than 100 ascii code allowed range from 32 to 140 demonstrate a condition that fix the correct letter for each generation Ex: 1st gen im a prof$smagdgaer, 2st gen im a progsamger Final gen (Im a programmer) use ArrayList to make the random permutations print number of generation that makes the correct sentence * Options..arrow_forwardCode in C++ Language STRING FLIP ALPHABET One of the simplest cryptography technique is to invert the characters such that the first character of the alphabet will be replaced to the last character, the second character be replaced to the second to the last, and so on. So all A's are turned into Z's, B to Y, C to X, and so on until X to C, Y to B, and Z to A. In a similar fashion, numeric characters will also be inverted such that 0 will become 9, 1 to 8, 2 to 7 and so on until 7 to 2, 8 to 1, and 9 to 0. Given a string composed of uppercase and lowercase letters, numbers, and spaces, your task is to invert them. You also must keep the case of the letters as is. Input: A string composed of uppercase and lowercase letters, numbers, and spaces. The quick brown 1 Fox jumps over the 6 lazy Dogs Output: The inverted string Gsv jfrxp yildm 8 Ulc qfnkh levi gsv 3 ozab Wltharrow_forward
- Write a program that reads in a line consisting of a students name, Social Security number, user ID, and password. The program outputs the string in which all the digits of the Social Security number and all the characters in the password are replaced by x. (The Social Security number is in the form 000-00-0000, and the user ID and the password do not contain any spaces.) Your program should not use the operator [] to access a string element. Use the appropriate functions described in Table 7-1.arrow_forwardplease solve those questions by python with (.py) filearrow_forwardUse python fast 20 minutesarrow_forward
- Greece has capital Athens. Each of the strings 'Greece', and 'Athens' has 6 characters. Show the name and capital where the name and the capital have the same number of characters. You can use the LENGTH function to find the number of characters in a stringarrow_forwardi need the answer quicklyarrow_forwardplease code in python Find the longest palindrome in a string and also print its length.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning