Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 30th, 2004, 01:05 AM
Registered User
 
Join Date: Oct 2004
Location: , , .
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

  #2 (permalink)  
Old November 9th, 2004, 07:59 AM
Authorized User
 
Join Date: Sep 2003
Location: den Haag, , Netherlands.
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

  #3 (permalink)  
Old November 11th, 2004, 01:52 AM
Registered User
 
Join Date: Oct 2004
Location: , , .
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




  #4 (permalink)  
Old February 18th, 2005, 10:22 AM
Registered User
 
Join Date: Feb 2005
Location: , , .
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??




  #5 (permalink)  
Old March 16th, 2005, 01:33 PM
Registered User
 
Join Date: Mar 2005
Location: , , .
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++
  #6 (permalink)  
Old March 27th, 2005, 07:30 PM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off




All times are GMT -4. The time now is 10:26 PM.


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