pset4 - MIT OpenCourseWare http:/ocw.mit.edu 6.00...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
MIT OpenCourseWare http://ocw.mit.edu 6.00 Introduction to Computer Science and Programming Fall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6.00: Introduction to Computer Science and Programming Problem Set 4 Handed out: Tuesday, September 24, 2008. Due: 11:59pm, Tuesday, September 30, 2008 . Introduction This problem set will introduce you to using successive approximation, as well as data structures such as tuples and lists. Collaboration You may work with other students. However, each student should write up and hand in his or her assignment separately. Be sure to indicate with whom you have worked. For further detail, please review the collaboration policy as stated in the syllabus. Submission This problem set, and future ones, will be auto-graded by a test harness. The test harness will expect your files to include just function definitions, with no executable code outside the function definitions. All your testing code should be in the appropriate test function, which is provided in the template; for example, the testing code for the futureRetire() problem should be in testFutureRetire(). Be sure to add test cases to these test functions beyond what is provided in the template! Planning for the future Recent events in the stock market may seem remote to you, but they underscore the uncertainty of planning for the future. People who had been thinking of retiring in the next year or so may have to rethink those plans, as the value of their 401K accounts drops noticeably. Although retirement may seem a long way off for you, we are going to explore some simple ideas in accruing funds. Along the way, we are going to explore the use of successive approximation methods, as well as the use of some simple data structures, like lists. We are going to start with a simple model of saving for retirement. Many employers will contribute the equivalent of 5% of your salary to a retirement fund, and then will match any contribution that you add, dollar for dollar, up to an additional 5%. Thus you can salt away up to 15% of your salary into a retirement account (10% of which comes as a bonus from your employer). We can model a retirement fund with some simple equations. Assume your starting salary is represented by salary; that the percentage of your salary you put into a retirement fund is ; and that the annual growth percentage of the retirement fund is growthRate. Then your retirement fund, represented by the list F, should increase as follows: save
Background image of page 2
Retirement fund End of year 1 F[0] = salary * save * 0.01 End of year 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/12/2010 for the course EECS 6.00 taught by Professor Grimson during the Spring '08 term at MIT.

Page1 / 6

pset4 - MIT OpenCourseWare http:/ocw.mit.edu 6.00...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online