This preview shows page 1. Sign up to view the full content.
Unformatted text preview: our expenses without
entering into debts. We will assume constant expenses on each year. How may we calculate it? One
option would be to try feeding different values of expenses to post_retirement() – and find the best value
(i.e. maximum expenses such that the last value in the returned list will still be a positive)
Remember that in class we saw the idea of binary search. We can use this idea also here to find the
correct value. In this assignment you may choose to use also pure arithmetics for this calculation.
Assignment 1
Implement l v _ i e a k n , which takes five arguments: a s l r , a percentage of your
ielk__ig
aay
salary to save (s v ), a list of annual growth rate before retirement
ae
(p e r t r _ r w h r t s, a list for after the retirement
r_eiegot_ae)
(p s _ e i e g o t _ a e ), and a value for stop searching (e s l n. As before the
otrtr_rwhrts
pio)
length of the p e r t r _ r w h r t s will be the amount of working years and
r_eiegot_ae p s _ e i e g o t _ a e ill account for the num...
View
Full
Document
This document was uploaded on 03/20/2014 for the course CMSC 67101 at Hebrew University of Jerusalem.
 Spring '14
 Avraham

Click to edit the document details