Javascript problem - Page 2 - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Programming
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 03-03-2009, 09:31 PM   #11 (permalink)
Oldie but a goodie
 
oldskool's Avatar
 
Join Date: Jun 2008
Location: Maine, USA
Posts: 1,762
Default 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]
oldskool is offline  
Old 03-03-2009, 10:30 PM   #12 (permalink)
Wizard Techie
 
CrazeD's Avatar
 
Join Date: Feb 2006
Location: Maine
Posts: 3,736
Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default 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!
CrazeD is offline  
Old 03-04-2009, 05:45 PM   #13 (permalink)
Oldie but a goodie
 
oldskool's Avatar
 
Join Date: Jun 2008
Location: Maine, USA
Posts: 1,762
Default 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]
oldskool is offline  
Closed Thread

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox 3.1 beta arrives with JavaScript booster turned off Osiris Internet Software and Browsers 3 10-15-2008 03:50 PM
Problem installing software in windows xp pro imagesmith Microsoft Windows and Software 3 02-20-2008 02:46 PM
Serious computer problem. HeeRoMaKi Hardware Repairs and Troubleshooting 71 07-28-2007 11:42 PM
Dhcp leasing problem Kloppstock Computer Networking and Internet Hardware 12 05-13-2007 07:13 PM
cant find the problem... Jhill1 Hardware Repairs and Troubleshooting 13 05-07-2007 04:51 PM



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 05:50 AM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.