• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Crazy date program

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic