Posted by: GreenMapleTree September 14, 2006
Java Programming Help!
Login in to Rate this Post:     0       ?        
Change this if { ( dateMonth > 0 ) ( dateMonth < 12 ) dateMonth = month; } To if { ( dateMonth > 0 ) && ( dateMonth < 12 ) dateMonth = month; //so what is the requirement if someone pass you invalid date/month or Year.. do you ignore it or replace with something? } to implement toString method do this public string toString(){ //if you need to add '0' in front of day and month do it here String dateString=month+"/"+date+"/"+Year } Phase II and III will be a piece of cake if you know how to implement Java's own calendar object. Calendar object will take care of adding/subtracting/... all the date calculation. You just need to know how to call it. I can do it for you but you won't learn anything. If this is for the first year programming course, instructor may not like it either. I think I even had this problem in my college days... but we had to do it in C++ with Object oriented methodology... that was 2 weeks of pure torture... but after that everything was downhill... If you can afford to put some time, do it now... it will reward you for the rest of your life...
Read Full Discussion Thread for this article