Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that prompts a user, using Scanner, for 4 secret messages. Each message has its own set of rules you need to use

Write a program that prompts a user, using Scanner, for 4 secret messages. Each message has its own set of rules you need to use to decode it. You will use the string methods to change the messages you receive from the user

image text in transcribedimage text in transcribed

Task: Write a program that prompts a user, using Scanner, for 4 secret messages. Each message has its own set of rules you need to use to decode it. You will use String methods to change the messages you receive from the user. *Note: Ensure that you make the changes in the order they are specified and do the operations on the updated String. Sentence 1 1. Change every x to an e. 2. Remove the first r. 3. Remove the first dollar sign. 4. Change every occurrence of zero to an o. 5. Append the 5th character to the end of the new string (do not remove the character, simply put a copy of it at the end). Sentence 2 1. Make everything after the first word lowercase. 2. Remove the last space. 3. Remove the first 3 characters. Change every z to an m. 5. Change every w to a space. 6. Find the first a and change it to a g. 4. Chand Sentence 3 1. Trim the extra white space from the sentence. 2. Replace every instance of "asdf" with the second character in the sentence. 3. Take the first 8 characters and put them at the end of the sentence. Sentence 4 The fourth sentence will be the combination of the following. 1. The first character 2. Index 10 to 15 (including 10 and 15) 3. Index 20 to 25 (including 20 and 25) 4. Index 30 to 35 (including 30 and 35) 5. Add an exclamation point at the end Print the final message as the four decoded messages concatenated in order

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Decisions Based On Data Analytics For Business Excellence

Authors: Bastian Weber

1st Edition

9358681683, 978-9358681680

More Books

Students also viewed these Databases questions