C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. 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
public static String pancakeScramble(String text) This nifty little problem is taken from the excellent Wolfram Challenges problem site where you can also see examples of what the result should be for various arguments. Given a text string, construct a new string by reversing its first two characters, then reversing the first three characters of that, and so on, until the last round where you reverse your entire current string.This problem is an exercise in Java string manipulation. For some mysterious reason, the Java String type does not come with a reverse method. The canonical way to reverse a Java string str is to first convert it to mutable StringBuilder, reverse its contents, and convert the result back to an immutable string, that is,str = new StringBuilder(str).reverse().toString();   Here's the tester it must pass: @Test public void testPancakeScramble() throws IOException {// Explicit test casesassertEquals("", P2J3.pancakeScramble(""));assertEquals("alu",…
Hi, so i am new to datastructure and algorithm, so i was asking if you could code the below algorithm in JAVA, please answer both the questions..cheers.
08.
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.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning