Javascript problem - Page 2 - Techist - Tech Forum

 Techist - Tech Forum Javascript problem
 Register FAQ Members List Calendar Search Today's Posts Mark Forums Read Log in
 Thread Tools Display Modes

03-03-2009, 08:31 PM   #11 (permalink)
Oldie but a goodie

Join Date: Jun 2008
Location: Maine, USA
Posts: 1,762
Re: Javascript problem

*Note: I turned in my code for this already to the instructor, so I will now state what the text problem says ....

Quote:
 "You can determine whether a year is a leap year by testing if it is divisible by 4. However, years that are divisible by 100 are not leap years, unless they are also divisible by 400, in which case they are leap years. Write a script that allows a user to enter a year and then determines whether the year entered is a leap year. Include a form with a single text box where the user can enter a year. Display an alert dialog box to the user stating whether the year they entered is a standard year or a leap year. "
Source: Javascript 4th Edition, Thomson Course Technology

So basically, CrazeD, to answer your question, the above code (mine) was my attempt to put all this together based on the text book problem. Does this make any more sense reading that to see what I was trying to do with my Javascript code ? Your solution gave me the right answers, but it didn't check out the other two scenarios. And that is because you didn't know the rest of the problem. So does this help you to see the problem clearer ?
As I said, I turned this in already, so any answers I get won't be applied to my homework (I'm not a cheater ).
__________________

__________________
[SIGPIC][/SIGPIC]

 03-03-2009, 09:30 PM #12 (permalink) Wizard Techie     Join Date: Feb 2006 Location: Maine Posts: 3,736 Re: Javascript problem That doesn't really clear it up for me. Seems like extra work really. Any year that is divisible by 4 is a leap year, so I don't understand why you'd need to divide by 100 and 400 as well. __________________ __________________ Intel Q9400 | Gigabyte EP45-UD3P | G.Skill 2x2GB DDR2 1000 | XFX HD5870 Need website help? PM me!
 03-04-2009, 04:45 PM #13 (permalink) Oldie but a goodie     Join Date: Jun 2008 Location: Maine, USA Posts: 1,762 Re: Javascript problem Actually, I don't understand it either, but that was in the book as you can see. I never sat and figured out WHY the question was written that way, they (whoever "they" are) must have found that mathematically there are times that those other two factors need to be considered I suppose. I just went with it. I want to say thanks for all your help, CrazeD __________________ __________________ [SIGPIC][/SIGPIC]http://counter.li.org/

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Osiris Internet Software and Browsers 3 10-15-2008 02:50 PM imagesmith Microsoft Windows and Software 3 02-20-2008 01:46 PM HeeRoMaKi Hardware Repairs and Troubleshooting 71 07-28-2007 10:42 PM Kloppstock Computer Networking and Internet Hardware 12 05-13-2007 06:13 PM Jhill1 Hardware Repairs and Troubleshooting 13 05-07-2007 03:51 PM

#### Our Communities

Our communities encompass many different hobbies and interests, but each one is built on friendly, intelligent membership.

» More about our Communities

#### Marine Communities

Our Marine websites focus on Cruising and Sailing Vessels, including forums and the largest cruising Wiki project on the web today.

» More about our Marine Communities