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

Mal.bengt

HI - I'm very new to computer programming and I cant even get through Problem set 1 by looking at the solution that is provided! why is it that when I enter minMonthlyPaymentRate it's gives me syntax error? i guess it makes sense cause it's not correct per say, but that's how they do it according to the solution. please help:)

  • one year ago
  • one year ago

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

    you may be missing ' ' give me an example of what you have written

    • one year ago
  2. Mal.bengt
    Best Response
    You've already chosen the best response.
    Medals 0

    minMonthlyPaymentRate = float(raw_input("enter minimum monthly payment rate")

    • one year ago
  3. Mal.bengt
    Best Response
    You've already chosen the best response.
    Medals 0

    it's just giving a syntax error message for the left side of the equal sign

    • one year ago
  4. Kidneys
    Best Response
    You've already chosen the best response.
    Medals 0

    == the product is equal to. give this a try..how mine is written

    • one year ago
  5. bdean20
    Best Response
    You've already chosen the best response.
    Medals 0

    You may also be missing a close bracket at the end of that line (note: brackets are also called parenthesis). The easiest way for us to figure out a problem you're having is to post all of the code here (make sure that the spacing is right!). It also helps to see the specific error python gave you.

    • one year ago
  6. Kidneys
    Best Response
    You've already chosen the best response.
    Medals 0

    ##heres how i figured this out..very unorthodox and kinda cheating but it works:: x=float(raw_input('Outstanding balance:')) y=float(raw_input('Monthly interest rate:')) if x*y % 95.83: print 'Minimum monthly payment: 95.83' this is only what i did playing around with the idea..not really what should happen!!!!

    • one year ago
  7. Kidneys
    Best Response
    You've already chosen the best response.
    Medals 0

    original_balance = float(raw_input("Enter the outstanding balance on your credit card: ")) interest_rate = float(raw_input("Enter the annual credit card interest rate as a decimal: ")) balance = original_balance low_payment = balance/12 high_payment = (balance*(1+(interest_rate/12))**12)/12 while True: balance = original_balance monthly_payment = (low_payment + high_payment)/2 for month in range(1,13): interest = round(balance*interest_rate/12, 2) balance += interest - monthly_payment if balance <= 0: break if (high_payment - low_payment < 0.005): print "RESULT" monthly_payment = round(monthly_payment + 0.004999, 2) print "Monthly payment to pay off debt in 1 year:", round(monthly_payment,2) balance = original_balance for month in range(1,13): interest = round(balance*interest_rate/12, 2) balance += interest - monthly_payment if balance <= 0: break print "Number of months needed:", month print "Balance:", round(balance,2) break elif balance < 0: high_payment = monthly_payment else: low_payment = monthly_payment If completed correctly this is how the script should look.

    • one year ago
  8. bwCA
    Best Response
    You've already chosen the best response.
    Medals 0

    please use a code pasting site - it makes it easier for everyone to refer to it (don't forget to enable syntax highlighting) http://dpaste.com http://pastebin.com (there are others) http://www.pythontutor.com/ is a good debugging tool

    • one year ago
  9. bwCA
    Best Response
    You've already chosen the best response.
    Medals 0

    @Mal.bengt you are definitely missing a closing paren in that line you posted

    • one year 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.