Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Adam_M

  • 2 years ago

Can someone help walk me though ps1b i am still trying to understand while functions and what happens when they are nested together

  • This Question is Closed
  1. MicroBot
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    please post your code with a paste site as pastebin.com, as it posts it correctly with the true indentations etc.:)

  2. Adam_M
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ok thanks, my questions though is does the program run one iteration of the first while function then go onto the second and run all interations until it is complete then go back and run another interation of the first while function and repeat the process of the second??

  3. Adam_M
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    http://pastebin.com/eTjTBxsW

  4. Adam_M
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    i guess a better way of wording this is that the computer won't go past line 35 until the conditions of the while statements are correct. i understand that but once the it gets to the second while statement won't the second while statement be ran 12 times before it returns to the first one on line 15 then it adds 10 to monthly payments and runs through all the loops again

  5. MicroBot
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    ok 1st of all u dont need the 1st while since u iterate balance in the 2nd. so try to fix this and see how it goes. i am now testing for correct results. did they give any test cases? so we know we are getting the correct results?

  6. Adam_M
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    well this is an exact copy of the code they provided as a solution i am just trying to walk through it and understand how it works

  7. Adam_M
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    and yes enter balance at 1200 and .18 interest should yield a monthly payment of 120 and 11 months

  8. MicroBot
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    ah well then lets see....

  9. Adam_M
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    i think i understand how this works now so no need i think just putting my questions to paper really helped me understand how it worked

  10. MicroBot
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    you always have to put questions and steps in paper...it helps a lot! it is some kind of pseudocode that you are creating when putting ur thoughts in paper. if you need any other help just ask. (if you need i have an other version of this with for loops).

  11. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

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.