Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program that translates sentences into Pig Latin. The rules for translating a word to Pig Latin are: 1. For words starting with

Write a Java program that translates sentences into Pig Latin.

The rules for translating a word to Pig Latin are:

1. For words starting with a consonant:

ay

strawberry awberrystray

2. For words starting with a vowel:

way

olive oliveway

Your program should accept and translate sentences until the user enters the word quit as a sentence. The sentences may contain punctuation.

Here is a sample run (user input shown in bold):

Enter a sentence or quit: The strength of the football team is their defense!

Translation: eThay engthstray ofway ethay ootballfay eamtay isway eirthay efenseday!

Enter a sentence or quit: Where are the good, spicy, tasty tacos found?

Translation: ereWhay areway ethay oodgay, icyspay, astytay acostay oundfay?

Enter a sentence or quit: quit

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

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

What is the relationship between humans?

Answered: 1 week ago

Question

=+ Should the MNE belong (why, why not)?

Answered: 1 week ago

Question

=+ What is the role of government in bargaining?

Answered: 1 week ago