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
for the following sequence of keys, do the following:
MBX, EXB, GBX,…, ABX, AXB,…, QXB, YXB, … .
1. Fill in the 3 blanks with strings from your first, second, and third name.
The following paragraph is a quote from William Faulkner, the renowned American writer and Nobel Prize laureate, on receiving the 1949 Nobel Prize for Literature.
I believe that man will not merely endure
he will prevail
He is immortal
not because he alone among creatures has an inexhaustible voice
but because he has a soul
a spirit capable of compassion and sacrifice and endurance
Use a String to hold this quote.
Convert all words to lower case
Split the String into a String[]
Count how many times the word "and" shows up in this paragraph
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 string
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
- 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_forwardesktop/CSE110%20OLab%20Assignment%203.ipynb Search b Assignment 3- er CSE110 Lab Assignment 3 (auftosaved) Lo View Insert Cell Kernel Help Pythons Not Trusted M Run Markdown bangla Task 2 Write a Python program that will ask the user to enter a word as an input. • If the length of the input string is less than 4, then your program should print the same string as an output. If the input string's length is greater than 3, then your program should add "er" at the end of the input string. • If the input string already ends with "er", then add "est" instead. • If the input string already ends with "est", then your program should print the same input string as an output. Example 1: Input: strong REDMI NOTE 9 AI QUAD CAMERAarrow_forwardC Programming That One Digit by CodeChum Admin Make me a program that accepts a random string (a series of characters). Then, look for a digit from that string and if there's at least one, print out "That one!" but if there's none, print out "No one..." I know this is too sudden to ask you, but thank you in advance! Tip: After your scan for the size, add a space after the placeholder like this so that the newline character directly after the number won't be scanned as one of the characters: scanf("%d ", &size); Input 1. Size of the string 2. Characters of the string Output The first line will contain a message prompt to input the size of the string. The second line will prompt for the characters of the string. The last line contains the appropriate string. Enter·the·size:·18 Enter·the·characters:·CodeChum1sAwesome! That·one!arrow_forward
- Python problem To decipher a code we must make a program that performs certain operations on the input string. -If they find 3 equal letters in a row, you must replace them with the next letter in the alphabet.-If you only find 2 equal letters in a row, you must replace them with the previous letter in the alphabet.-The comma must be removed-The period should be left and a space added after it.-All other characters should be left as isNote that in this case after the "Z" is the "A", and therefore before the "A" is the "Z". Given a string S, execute the operations described above, until no more can be executed. For example: GHHGP, OOOMMZAAZ => GGGPPLZZZ => HELLO EntryThe input will be a single line containing the string S. The string only includes uppercase letters of the English alphabet and special characters. DepartureYou must print the resulting string in double quotes ". Examples Input Example 1 LLLENTTA, JDDD OBCCBUMMTO!Output Example 1 "HIDDEN MESSAGE!" Input Example 2…arrow_forwardPython problem To decipher a code we must make a program that performs certain operations on the input string. -If they find 3 equal letters in a row, you must replace them with the next letter in the alphabet.-If you only find 2 equal letters in a row, you must replace them with the previous letter in the alphabet.-The comma must be removed-The period should be left and a space added after it.-All other characters should be left as isNote that in this case after the "Z" is the "A", and therefore before the "A" is the "Z". Given a string S, execute the operations described above, until no more can be executed. For example: GHHGP, OOOMMZAAZ => GGGPPLZZZ => HELLO EntryThe input will be a single line containing the string S. The string only includes uppercase letters of the English alphabet (Does not include Ñ) and special characters. DepartureYou must print the resulting string in double quotes ". Examples Input Example 1 LLLENTTA, JDDD OBCCBUMMTO!Output Example 1 "HIDDEN…arrow_forwardUsing function strtod(), Create a character string that contains the following string: “78.3% is the average success rate” Divide this string into double and display the rest of the string The output will be: The original string is: 78.3% is the average success rate The extracted double value is: 78.3 The remainder of the string is: % is the average success ratearrow_forward
- HO Webcom /Desktop/CSE110%20Lab%20Assignment%203.ipynb Search Lab Assign ment 3- X cer CSE110 Lab Assignment 3 (autosaved) Logout it View Insert Cell Kernel Help Python 3 O Not Trusted N Run Markdown bangla Task 2 Write a Python program that will ask the user to enter a word as an input. • If the length of the input string is less than 4, then your program should print the same string as an output. • If the input string's length is greater than 3, then your program should add "er" at the end of the input string. • If the input string already ends with "er", then add "est" instead. If the input string already ends with "est", then your program should print the same input string as an output. Example 1: Input: strong REDMI NOTE 9 AI QUAD CAMERAarrow_forwardGiven table is the ascii value of the characters and symbols. The following code is the code for XOR Encryption: Change the input string in the driver code at the sample string. def encrypt(inpString): xorKey = 'e' Which of the following is the message HELLO TUTOR after xor encryption, using 'e' as the key, has been applied? - ))*E101*7 -$55<E'H!$< =$(E7 3,6 - ),"*)$+!6 Which of the following is the message HELIGOLANDS after xor encryption, using 'e' as the key, has been applied? - )5E( E5)6 - ),"*)$+!6 - ))*E207)< - ))*E2*7)! Which of the following is the original message before xor encryption, using 'e' as the key, created - ),"*)$+!6? HELP ME PLS HELIGOLANDS HELLO WURLY HELLO WORLDarrow_forwardFind given two strings are same or not. If same print 0 lese print 1. String must be case sensitive. Example: s1:data S2: data Output:0 S1:Data S2:data Output:1arrow_forward
- Pick the first four numbers of your index number eg. 0401 if index number is 04011212 i. 45 i. 654 ii. 545 iv. 665 v. 6565 a. Use your index number as n1=0401 and let n2= 45. Using Fibonacci series, generate the values of n3 up to n10. Do this for i., ii, i and v. b. Write the c++ code for generating i.arrow_forwardQ5\A) The Amplitude Modulation (AM) is a technique used in communication for transmitting information via radio carrier wave. AM works by varying the amplitude of the transmitted signal in relation to the information being sent. The equations of the carrier signal, the original signal to send, and the modulated signal combining the two signals are respectively: VI-V sin (2nfet) V2=Vm sin (2πfmt) V3-V sin (2nfet)+ Vm sin (2nfmt)* sin (2πfet) Supposing that Vc =Vm=1, fc-20, fm-1. Write a MATLAB program that plots the three signals with single call, the graphs must be contain (desired title, axis labels, annotations, with symbols for color, style, and marker) for each graph. Use the step 0.0025 for the time.arrow_forwardLet's dive into decorators! You are given mobile numbers. Sort them in ascending order then print them in the standard format shown below: +91 xxxxx xxxxx The given mobile numbers may have , or written before the actual digit number. Alternatively, there may not be any prefix at all. Input Format The first line of input contains an integer , the number of mobile phone numbers. lines follow each containing a mobile number. Output Format Print mobile numbers on separate lines in the required format. Sample Input 3 07895462130 919875641230 9195969878 Sample Output +91 78954 62130 +91 91959 69878 +91 98756 41230 Concept Like most other programming languages, Python has the concept of closures. Extending these closures gives us decorators, which are an invaluable asset. You can learn about decorators in 12 easy steps here.To solve the above question, make a list of the mobile numbers and pass it to a function that sorts the array in ascending order. Make a decorator that standardizes…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