Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C++ The name of the file must be encrypt.cpp Write a program that prompts the user to enter a text to be encrypted, parse
In C++ The name of the file must be encrypt.cpp Write a program that prompts the user to enter a text to be encrypted, parse the text, process it and display the text encrypted using the following algorithm: All punctuations are discarded, this includes commas(), dots(.), question marks(?), exclamation marks(), semicolons), and colons( -If the string starts with a vowel, move the last 3 letters to the beginning of the string then add the symbol at the beginning If the string starts with a consonant, move the first 3 letters to the end of the string and add the ' symbol to the end For any string that is of length less than or equal to 3, reverse the order of the string and add a to the beginning and %, to the end of the string You can read the input as a C-string or a string object, however, using string class for this homework is recommended. A tokenizing function should be used first, it will use the space as a delimiter. For example: Hello, everyone! This is: COSC-1436, SP18" has 5 space delimiters 6 tokens Sample Run Enter a sentence with 10 or less words and it will be encrypted: Hello, everyone! This is: COSc-1436, SP18 The unencrypted tokens are: Hello everyone This is COSC-1436 SP18 The encrypted tokens are: loHel@ oneevery sThi@ #5 i% C-1436C0S@ 8SP10 The encrypted text for this input string is: LoHeL@oneeverysThi@#sisc-1436COS@8SP1@
In C++
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started