Challenge 40– When will the sun rise?
Challenge 40 involved computing when the sun rise will rise, based upon the following inputs:
- Calendar Date
- Elevation above sea level (optional)
The following is prototype function to compute when the sun will rise. Please fill in the missing information and use any data type you like in order to get the MOST ACCURATE result.
- Given a calendar date, and location on the earth measured by Latitude, Longitude, and elevation above sea level (optional) compute sun rise time to the nearest second.
- Any programming language can be used.
- Winner will be judged on accuracy and completeness of the solution.
The following is a good response as submitted by Vishwapriya Sivaraman.
Vishwapriya found a library on the internet, Innovative.SolarCalculator, that could do the calculations, sparing her from implementing complex math and code.
The library was found on Github. https://github.com/porrey/Solar-Calculator
Winners (out of approximately 10 respondents)
Thanks to everybody for your responses to SCS Coding Challenge #40!!!
Congratulations to Vishwapriya Sivaraman for her fine effort to come up with a workable algorithm.
|Name||Prize Winner||Good Answer|
Monthly Programming Tidbits
Pay attention to the name of your identifiers
Name of your identifiers is as important as the name of your children. I’m dead serious. No one wants to read someone else’s code with the following identifiers:
od: What is od? Oh Damn? Obsessive Disorder? Overdue Days?
Button1_Click(): What is Button1? How is it different from Button2?
thisAs: What’s that even supposed to mean?!
Use a name that clearly communicates the intent.
Coding Challenge #41
Please stay tuned, SCS Coding Challenge #41 will be published later this month. Details will follow. The winner will be awarded based upon the best approach.