Question
No looping statements allowed (or needed). This question requires the use of the functions: length(), substring() Question 2 Letter Encryption (8 points) Write a program
No looping statements allowed (or needed). This question requires the use of the functions: length(), substring()
Question 2 Letter Encryption (8 points) Write a program that prompts the user for two words (W1 and W2) with 3 characters. Your program should behave as follow: 1. Display a welcome message.
2. Ask the user for the inputs of two words.
3. Display the lengths of both words.
4. Use a new string to merge two words. The new word should follow:
a. The sequence: 3rd character of W1 + 3rd character of W2 + 1st character of W1 + 1st character of W2 + 2nd character of W1 + 2nd character of W2, display the new generated word.
b. Swap the 2nd and 6th characters of the new word.
c. Swap the 1st and 5th characters of the new word.
5. Display the new word.
6. Display a farewell message, so that the user knows that the program has terminated normally.
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