C++ How To Program (Early Objects Version), Global Edition, With Access Card, 10 Ed
10th Edition
ISBN: 9780134448848
Author: Paul Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 21, Problem 21.14E
Program Plan Intro
- Include header files.
- Make two character arrays “ a” and “ b ”.
- Get the message in “ a ”.
- Use “strlen()” function to get length of the entered message in variable “ len ”.
- Run the for loop for value 1 to len
- Convert every character to lowercase using “tolower()” function.
- If character is not space then check that if we add 13 to the current character i.e. a[i], the resultant character is less than or greater than character ‘z’.
- If not going beyond ‘z’ then make b[i]=a[i]+13. else make b[i]=a[i]-13.
- If current character a[i] is space make b[i]=a[i], which means putting space in array b.
- End of for loop
- Put ‘\0’ − null character in the end of array b.
- Display the array b as encrypted message.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
List out the errors in the following code?
What is the output from the following statement?
Write the following
Chapter 21 Solutions
C++ How To Program (Early Objects Version), Global Edition, With Access Card, 10 Ed
Ch. 21 - Prob. 21.4ECh. 21 - Prob. 21.5ECh. 21 - (Find Code Error) Find any errors in the following...Ch. 21 - (Simple Encryption) Some information on the...Ch. 21 - Prob. 21.8ECh. 21 - Prob. 21.9ECh. 21 - (String Concatenation) Write a program that...Ch. 21 - (Hangman Game) Write a program that plays the game...Ch. 21 - (Printing a string Backward) Write a program that...Ch. 21 - (Alphabetizing Animal Names) Write a program that...
Ch. 21 - Prob. 21.14ECh. 21 - Prob. 21.15ECh. 21 - Prob. 21.16ECh. 21 - Prob. 21.17ECh. 21 - Prob. 21.18ECh. 21 - (Erasing Characters from a string) Write a program...Ch. 21 - Prob. 21.20ECh. 21 - Prob. 21.21ECh. 21 - Prob. 21.22ECh. 21 - Prob. 21.23ECh. 21 - Prob. 21.24ECh. 21 - Prob. 21.25ECh. 21 - (Cooking with Healthier Ingredients) Obesity in...Ch. 21 - Prob. 21.27MADCh. 21 - (SMS Language) Short Message Service (SMS) is a...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
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