In Java Write A Program Main Method That Prompts The User For A Doubled String Where 2743334

In Java, write a program (main method) that prompts the user for a “doubled” String, where every
character is immediately duplicated. It prints the un-doubled version. Include a loop so that the user is repeatedly prompted. Below is an example transcript.

Please enter a doubled string:
aabbcc
Undoubled is abc
Do you want to play again? (y/n)
y
Please enter a doubled string:
SShhaarrkk88mmee
Undoubled is Shark8me
Do you want to play again? (y/n)
n

Extend the previous solution so that it verifies that the input is doubled. If so, it behaves as above.
If not, it prints an appropriate error message.

Prof. Angela

4.6/5

Calculate Price


Price (USD)
$
Open chat