Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Write a program that prompts a user, using Scanner, for 2 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:

  • Make everything after the first word lowercase
  • Remove the last space
  • Remove the first 3 characters
  • Change every z to an m
  • Change every w to a space
  • Find the first a and change it to a g

Sentence 2:

  • Trim the extra white space from the sentence
  • Replace every instance of asdf with the second character in the sentence

Take the first 8 characters and put them at the end of the sentence

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_2

Step: 3

blur-text-image_3

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

MFDBS 91 3rd Symposium On Mathematical Fundamentals Of Database And Knowledge Base Systems Rostock Germany May 6 9 1991

Authors: Bernhard Thalheim ,Janos Demetrovics ,Hans-Detlef Gerhardt

1991st Edition

3540540091, 978-3540540090

More Books

Students also viewed these Databases questions