This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes Cattle Drive problem 3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Cattle Drive problem 3" Watch "Cattle Drive problem 3" New topic
Author

Cattle Drive problem 3

Aman Singh
Ranch Hand

Joined: Oct 30, 2008
Posts: 57
Hi Folks,

Could you please hint me with what am I doing wrong with this problem.





[edit: we do not allow students to post actual code for the Cattle Drive, since it would deprive other students of learning opportunities]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please see ItDoesntWorkIsUseless and TellTheDetails.

You might want to look up how to calculate a leap year, too.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18545
    
  40


There some very specific rules when working with the cattle drive -- of which I am not sure if you are violating them.

Regardless, this topic is being moved to the cattle drive forum, to be sorted out there.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Aman Singh
Ranch Hand

Joined: Oct 30, 2008
Posts: 57
@ David,

I am trying to satisfy these three conditions:

Leap occurs:-

on every year that is evenly divisible by 4

except every year that is evenly divisible by 100

except every year that is evenly divisible by 400.
Gary Ba
Ranch Hand

Joined: Oct 23, 2009
Posts: 150

Check this thread out on Cattle Drive. It should help you with the requirements and hopefully the code.

"Different way of thinking about Leap"

star chaser..
Aman Singh
Ranch Hand

Joined: Oct 30, 2008
Posts: 57
Hi Gary,

Thanks for the help. I will read it. I came up with this, Am I anywhere close?




[edit: we do not allow students to post actual code for the Cattle Drive, since it would deprive other students of learning opportunities]
Gary Ba
Ranch Hand

Joined: Oct 23, 2009
Posts: 150

Yes you are close. You need to know what a leap year is first. Your rules are not correct. Carefully read through the thread that I mentioned. Also, send your code to your nitpicker, he/she will be able to guide you.
Katrina Owen
Sheriff

Joined: Nov 03, 2006
Posts: 1357
    
  17
Hi Aman, welcome to the Cattle Drive!

I've edited your posts to take out the actual code, since we want each student to come up with their own solution.

Do feel free to ask questions about problems you encounter. You can use pseudocode to help explain what you are wondering about.

Regards,
Katrina
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Cattle Drive problem 3
 
Similar Threads
Cattle Drive Problem 1
what is this forum all about ??
How can I convert numeric to words.
J2SE SDK 1.4 from Sun
projects that can be done in java