Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!

# Cattle Drive problem 3

Aman Singh
Ranch Hand
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
Posts: 12617
Please see ItDoesntWorkIsUseless and TellTheDetails.

You might want to look up how to calculate a leap year, too.

Henry Wong
author
Marshal
Posts: 21745
85

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

Aman Singh
Ranch Hand
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
Posts: 161
Check this thread out on Cattle Drive. It should help you with the requirements and hopefully the code.

"Different way of thinking about Leap"

Aman Singh
Ranch Hand
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
Posts: 161
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
Posts: 1367
18
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