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

ManuStarlight Group Title

I've just made a solution for ps4 problems and according to the test cases given, it is correct, but I want to compare it with other people solutions so I'm posting mine here and I'll wait for some of you to do the same if you'd please :) [forgive me for any english language issues 'cause I don't live in a english-speaking country]

  • 3 years ago
  • 3 years ago

  • This Question is Closed
  1. ManuStarlight Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    I forgot the code, here it is: http://dpaste.com/hold/572017/

    • 3 years ago
  2. Joz Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    I'll post mine up later because it is saved on the other computer, I don't have access right now. I'm interested too, as I didn't give mine an aggressive testing, so be warned it could be wrong.

    • 3 years ago
  3. Joz Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    http://dpaste.com/572109/ okay that's mine.

    • 3 years ago
  4. ManuStarlight Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    Thanks! I was looking for a different style of thinking the problem and that's exactly what I found in your solution =)

    • 3 years ago
  5. AdisA Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    This is mine: http://dpaste.com/572961/ ManuStarlight, our solutions for problem 4 are very similar. Joz, I think you forgot that your variable maxExpenses should have value of savings, which you can get from your function postRetirement() You wrote: maxExpenses = 200000

    • 3 years ago
  6. Joz Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    Ah yes, you are right. I just put an arbitrary upperbound which I thought would be quite high and so not fail. Very interesting to go back and look, there are a number of things that I can improve upon here in my code.

    • 3 years ago
  7. Joz Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    Wow, the importance of comments.... I just ran my test, and it didn't work out... I forgot that when I wrote it I changed a bunch just to see if it ran. But I didn't comment, and I just left "should equal 1229....) I just spent time debugging a non-problem...

    • 3 years ago
  8. Joz Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    Cool, I have improved my program a lot with thanks to both. http://dpaste.com/573810/ assert statements, abs, maxExpenses, and generally making it more consise...

    • 3 years ago
  9. AdisA Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Now it's look very good, with all that comments.

    • 3 years 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.