• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Crazy date program

 
Robert Mabrey
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fixed my original problem but now this code only works up to a certain point. I had it working fine but then i changed some variable names and i messed up something and im not sure what. It stops where the ***** are and wont doing anything below.Hopefully you more experienced programmers out there can tell me what is wrong. thanks


[ April 29, 2008: Message edited by: Robert Mabrey ]
[ April 29, 2008: Message edited by: Robert Mabrey ]
 
abhishek pendkay
Ranch Hand
Posts: 184
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Robert , your program is fine except for one logical error you made

check out the first line of your code after **************************

if(0<day&&day>=31) this if condition is not correct , the correct condition would be if(0<day&&day<=31)
now your program should work fine
you were originally checking if day is greater than 0 and greater than 31 , but you should have checked if day greater than 0 and less than or equal to 31...
also after the condition if(month == 2) you have missed out a bracket , so check that too
[ April 29, 2008: Message edited by: abhishek pendkay ]
 
Robert Mabrey
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you i did find the bracket and that fixed it however I did not notice the (0<d&&d<=31) Program works fine now

again thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic