From: "Victor H. Goff III" Date: 2008-10-16T16:24:31+09:00 Subject: Re: Help with leap year programing ------=_Part_24356_19812453.1224141882809 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline :) That is what I am talking about... I just ran it from my e-mail... much better for the assignment. You are greatly improving, by the way! Warmest Regards, Victor H. Goff III Voice (218) 206-2470 On Thu, Oct 16, 2008 at 2:14 AM, Bernie Loriaga wrote: > I have a little modification, I included the minutes in a year. > > > #!/usr/bin/ruby > > puts "please enter starting year:" > STDOUT.flush > starting = gets > > puts "please enter end_year:" > STDOUT.flush > end_year = gets > > year = starting.to_i > > while year <= end_year.to_i > > leapyear = > if year % 400 == 0 > true > elsif year % 100 == 0 > false > else > year % 4 == 0 > end > > > if leapyear: puts "#{year}-> This year is a leapyear and #{366*60*24} > minutes" > else > puts "#{year}-> Not a leapyear #{365*60*24} minutes" > end > year += 1 > end > > > Good day, > Bernie Loriaga > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_24356_19812453.1224141882809--