Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a JAVA program Question: Word Separator and Pig Latin Write a program to perform the following two tasks: 1. The program will accept a

write a JAVA program

Question: Word Separator and Pig Latin

Write a program to perform the following two tasks:

1. The program will accept a string as input in which all of the words are run together, but the first character of each word is uppercase. Convert the string to a string in which the words are separated by spaces and only the first word starts with an uppercase letter. For example, the string "StopAndSmellTheRose" would be converted to "Stop and smell the roses". Display the result string.

2. Then the program will convert each word in the result string of task 1 into "Pig Latin" and display the result string. In one version of Pig Latin, you convert a word by removing the first letter, placing that letter at the end of the word, and then appending "ay" to the word.

For example, for the result string "Stop and smell the roses" in task 1, the Pig Latin string should be "topSay ndaay mellsay hetay osesray"

Requirements:

  • Your program should have 3 methods: a main method, a method for task 1, and a method for task2
  • the method for task 1 should return the result string of task1
  • the method for task 2 should display the Pig Latin string
  • Submit the repl.it link

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

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions