Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 03-03-2009, 09:31 PM   #11 (permalink)
oldskool's Avatar
 
Electrical Systems Design

Join Date: Jun 2008

Location: Maine, USA

Posts: 1,652

oldskool has a spectacular aura aboutoldskool has a spectacular aura about

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 ).
__________________
  • Operating system(s) : Windows 7 Home Premium x64 | Ubuntu 9.10
  • CPU : Pentium Dual-Core E5200 @ 2.50GHz /Socket 775 LGA
  • Memory: 2X 2GB DDR2 SDRAM
  • Hard drive: 640 GB Western Digital Caviar Blue 7200rpm WD6400AAKS-75
  • Motherboard : Dell 0U880P
  • Video: nVidia GeGorce 8400GS
  • Chipset : Intel G41

<<<<< If you found anything I said helpful, please click the or under my avatar

Last edited by oldskool; 03-03-2009 at 09:33 PM. Reason: gave credit to text source
oldskool is offline  
Old 03-03-2009, 10:30 PM   #12 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,690

CrazeD will become famous soon enough

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.
__________________

Need website help? PM me!
CrazeD is offline  
Old 03-04-2009, 05:45 PM   #13 (permalink)
oldskool's Avatar
 
Electrical Systems Design

Join Date: Jun 2008

Location: Maine, USA

Posts: 1,652

oldskool has a spectacular aura aboutoldskool has a spectacular aura about

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
__________________
  • Operating system(s) : Windows 7 Home Premium x64 | Ubuntu 9.10
  • CPU : Pentium Dual-Core E5200 @ 2.50GHz /Socket 775 LGA
  • Memory: 2X 2GB DDR2 SDRAM
  • Hard drive: 640 GB Western Digital Caviar Blue 7200rpm WD6400AAKS-75
  • Motherboard : Dell 0U880P
  • Video: nVidia GeGorce 8400GS
  • Chipset : Intel G41

<<<<< If you found anything I said helpful, please click the or under my avatar
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 On


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