Home Forums Gamescan Chat42 About
* Login   * Register * FAQ    * Search
It is currently Thu 07-31-2025 8:21AM

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: IST 151 (Java) help
PostPosted: Wed 03-22-2006 6:06PM 
Offline
Colonel
User avatar

Joined: Sun 09-12-2004 8:22PM
Posts: 657
Location: somewhere

Source: Kappa Sigma
So i'm going to do my java program thats due in 6 hours, and i realize that my input/output is supposted to be based of off the code in a book I dont have.
So I'm looking for anyone who has the java book and is willing to either scan or take a picture of page 635 (Programming Project 1) from the book and either post it here or give me the link.
Thanks.

_________________
if you woke up as me everyday, you'd hate yourself too.


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Wed 03-22-2006 10:02PM 
Offline
Colonel
User avatar

Joined: Sun 09-12-2004 8:22PM
Posts: 657
Location: somewhere

Source: Kappa Sigma
anybody? This is literally all that I have left to do on it.

_________________
if you woke up as me everyday, you'd hate yourself too.


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Wed 03-22-2006 10:50PM 
Offline
General
User avatar

Joined: Mon 09-22-2003 3:29PM
Posts: 4317
Location: Find out on irc

Source: Fidelity
System.out.println("Please enter a date 'MM/DD/YYYY'");

System.out.println(month + " " + day + ", " + year);

thats what i did and john said it was fine

so input

01/02/1986

output

January 2nd, 1986

_________________
_______Notebook_________Gaming - Circa 2008ish
proc___T8300____________Q6600
clock-----------2.4GHz-----------
ram--------------4GB------------
vid__GF8600M GT 256MB__2xGF8800GTS 512MB sli
hdd____160GB_______3.5TBw/parity on a 3ware card


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Wed 03-22-2006 11:18PM 
Offline
Colonel
User avatar

Joined: Sun 09-12-2004 8:22PM
Posts: 657
Location: somewhere

Source: Kappa Sigma
Good, because that basically what i did, except i put the output as a single string.

_________________
if you woke up as me everyday, you'd hate yourself too.


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Thu 03-23-2006 2:31PM 
Offline
Major

Joined: Wed 08-18-2004 6:51PM
Posts: 246

Source: Kelly Hall
You guy'll like this then:

stringvariable.trim().matches("^(((0?[1-9]|1[012])/(0?[1-9]|1\\d|2[0-8])|(0?[13456789]|1[012])/(29|30)|(0?[13578]|1[02])/31)/(19|[2-9]\\d)\\d{2}|0?2/29/((19|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00)))$")

returns true if matches MM/DD/YYYY (with spaces on the edges removed), with leap year since 1900 apparently.


Top
 Profile  
    
 Post subject:
PostPosted: Thu 03-23-2006 4:03PM 
Offline
Colonel

Joined: Sun 05-01-2005 4:29PM
Posts: 501

Source: TJ North
That's some regex...


Top
 Profile  
    
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group