Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

eSpeX

For Review: I mocked up "Exercise OPT.1 – Zeller’s Algorithm" http://pastebin.com/59iL8cXH

  • 9 months ago
  • 9 months ago

  • This Question is Open
  1. eSpeX
    Best Response
    You've already chosen the best response.
    Medals 1

    Seems I forgot December in my code. :) http://pastebin.com/c4Rhdavv

    • 9 months ago
  2. eSpeX
    Best Response
    You've already chosen the best response.
    Medals 1

    One bore bug found/fixed. The else statements were allowing the user to bypass the checks. http://pastebin.com/rkA34n8e

    • 9 months ago
  3. eSpeX
    Best Response
    You've already chosen the best response.
    Medals 1

    My third debug. There was an issue in the month section that would go into an infinite loop if you had a 2-digit number that was outside of the standard 1-12 range. Hopefully this is it. http://pastebin.com/wyyZCTxL

    • 9 months ago
  4. ansakoy
    Best Response
    You've already chosen the best response.
    Medals 0

    This is Python 3, right?

    • 9 months ago
  5. eSpeX
    Best Response
    You've already chosen the best response.
    Medals 1

    It is, yes.

    • 9 months ago
  6. TomDeBeauchamp
    Best Response
    You've already chosen the best response.
    Medals 0

    Reading this impresses on me the need to control input. The vast majority of your code is making sure users give you input your code can use. That's a good lesson. The version I wrote works only when the user knows what to enter. https://gist.github.com/TomDeBeauchamp/5872762

    • 9 months ago
  7. eSpeX
    Best Response
    You've already chosen the best response.
    Medals 1

    It is worth noting that I started with code very similar to yours. Only once I had the underlying logic working did I start to explore the input control.

    • 9 months ago
  8. S.Campbell
    Best Response
    You've already chosen the best response.
    Medals 0

    That's a lot of input control. My design goal was to get this over with and I typo at a fairly high rate, and so I skipped the input checking and went with ease of input. For the initial coding, I set strings to month, day, and year. Here's a link to my Python 3 answer, if you want to compare input styles. https://gist.github.com/scampbel/5888834#file-ocw_zellers-py (and I wanted to test posting a link to code :-)

    • 9 months ago
  9. gregsmyth
    Best Response
    You've already chosen the best response.
    Medals 0

    My attempt is here: https://github.com/gregsmyth/MOOC_homework/blob/master/zeller.py The main bug I encountered was forgetting how the slicing indices relate to the spaces between elements.

    • 9 months ago
  10. Neec0
    Best Response
    You've already chosen the best response.
    Medals 0

    Finally had some free time to start catching up. Here is mine, without error checking. http://pastebin.com/0w4dESPx

    • 9 months ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.