Wrox Programmer Forums
|
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 30th, 2004, 01:05 AM
Registered User
 
Join Date: Oct 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default PIglatin

For this program you will be working with strings. You are to ask
the user to input a string. Then, make (and print out) the "pig
latin like" version of this string by using the following rule:


1) words beginning with a vowel (A, E, I, O, U) , have the word "way"
appended to the word
2) words beginning with a consonant, move the first character to the
end of the word and append "ay"


For example, if the user inputs:
rice
Ant
ice
mary
You should output:
iceray
ntaway
ceiway

arymay.

yeah. and also have to be back from pig latin to english.

all rite guys! pls help me ! i will be waiting for ur replies

thx
casper

 
Old November 9th, 2004, 07:59 AM
Authorized User
 
Join Date: Sep 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Casper,
you can't expect me to do all your homework for you!

I liked the previous exercise about numbers that you posted. But dealing with strings is always a bit tedious, and less of an inspiration to me.

Re-signing:
Frans
Netherlands

 
Old November 11th, 2004, 01:52 AM
Registered User
 
Join Date: Oct 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yeah buddy,
        I have done it already! i just used the "substring and charAt" functions. and it works!!
anyway, thx for ur reply and help.
yeah.. for those who r having problem with PIGLATIN. i could help u guys!

regards,
hanhtoo




 
Old February 18th, 2005, 10:22 AM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by casper
 yeah buddy,
        I have done it already! i just used the "substring and charAt" functions. and it works!!
anyway, thx for ur reply and help.
yeah.. for those who r having problem with PIGLATIN. i could help u guys!

regards,
hanhtoo

hey i have that same problem and i cant figure out how to do it :(...i know its been awhile but could u still help me??




 
Old March 16th, 2005, 01:33 PM
Registered User
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

casper could you help me to do a pig latin program that only goes by the first letter of each word in a string in c++
 
Old March 27th, 2005, 07:30 PM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I know it's a bit OT, but hey - in perl you could do:

#!/usr/bin/perl

while(<>) {
        s/^[aeiou](.*)/$1way/gi;
        print;
}

java has regular expressions, too - google it ;)

--
Don't Stand on your head - you'll get footprints in your hair. http://www.charlieharvey.org.uk









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.