Real-World Programs Comments
Comments
-
I wonder why my code doesn't pass muster? I tried it in TextPad, and it worked fine. Here, it doesn't....
-
Sorry please make sure to print out the output for each game on its own line.
-
Sorry in return; I think I already fixed it.
-
-
It's not really efficient.. but it works...
https://www.learneroo.com/user_answers/8006285755 -
THANK....... finally, it ook me half a day :-( really hard..
a solution:
my code -
wow, so there's a simple way :) I've overcomplicated it I guess...
my codelast year I gave up here, so now I know why :D
-
-
Didn't know I'm able to use math.round, without it: my code.
-
-
Can someone explain the challenge like I am 5?
I am not very good at this mortgage stuff and therefore I can't see the question properly. -
One example to understand the question would be nice , yes.
-
It does not make sense. What if i payed the whole mortgage at once. In example 1 this will cost 106000 dollar. My fund will be 46500 dollar ( i first collect the rent). And done with it. right? Then the interest of the remaining 19 years will give me a total fund off 46500*1.0219=67741 dollar. Its a lot more then 11490?
I dont understand the question?
-
You need to pay $5k + interest each year. The only decision is how much to sell from your mutual fund. (This is an 'alpha' challenge though, so don't worry about it too much.)
-
I do worry about it much. I want to do this. But i dont understand the question. Is there an example.. Can i sell all at onces or not? What happens when i sell?
-
You can sell any amount at once (and save on fees), but you'll miss out on annual earning from your fund (
a
). -
I am really sorry but i think your output is wrong. I i can sell everything at once, then for example one i have more then 11490 left.
-
It's possible there's a mistake (it's an alpha challenge), but selling everything at once is not optimal, since you're giving up earnings in your fund, but still need to pay the same interest on mortgage.
Example: Let's say you just sell $30k the first year (so you after $29,500 cash after the $500 fee). You'll now earn 2% interest for the next 5 years, so your $120k will turn into $132,489.69. ($120k*1.025). You'll need to spend another $500 to sell funds again after 5 years, but you gained $12k.
-
No i i take al the money at once i can pay off my mortgage at once. I dont have to pay anything afther that. In example 1 the output then will bi higher. Try it for yourself. Example one, pay off everything at once. You will get a higher amount then what it says.
-
As I mentioned, you need to pay $5k + interest each year. You cannot pay off more than $5k of the principal each year. The only decision is how much to sell from your mutual fund, not how much to pay for the mortgage.
-
Weird. Since the funds money i talk depends on the mortage. Nevermind, the question is still not clear. The rules arent clear to me at all.
But i give it up. Thx for the comments never the less!
-
-
Hm, not getting it....You say "The only decision is how much to sell from your mutual fund".
But...you have a yearly income, and when the total sum you have to pay to the bank is larger than that income by x, then you have to sell off x from your fund. Where is there a decision in that?
-
And yes, like the others I feel there should have been one worked out example, like the challenges before this one had. Now I have no way of knowing whether my programming is wrong, or my understanding of the challenge.
-
-
Isnt there an esier way to round up numbers to n decimal places?
a solution:
my code -
We have to make a precision, for which there is no method? That's brutal.
-
I finally got the precision done, but only by copying and pasting a solution for that issue from Quora. It really would be helpful if we were led to a solution, sometimes. Right now I don't feel I'm learning from this.
-
In this case, Googling for how to round numbers would be good practice for real world programming.
-
-
https://www.learneroo.com/modules/49/nodes/293
Can anyone help me understand what I am doing wrong? I took the approach of saving the x and y values to their own arrays, and then iterating throughuntil I found the coordinates. I match up with the first set of Correct Output, but not the second or third.
-
See this post for an explanation of an optimal solution.
-
-
Is there a solution ( not explanation) that i can see. I got a solution but if this is a good one i really dont know. I want to know if there is a better way?
thales
Jul 19, 9:18 AMa solution ( dont forget to print the last on a new line!)
my code