C++ How To Program (Early Objects Version), Global Edition, With Access Card, 10 Ed
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
bartleby

Concept explainers

Question
Book Icon
Chapter 21, Problem 21.14E
Program Plan Intro

Program Plan:

  • 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.

Blurred answer
Students have asked these similar questions
List out the errors in the following code?
What is the output from the following statement?
Write the following
Knowledge Booster
Background pattern image
Computer Science
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.
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning