Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: pension and return a tuple where its 1st value is the name of the fund and the 2nd is the value of the retirement account after retirement. How to choose a best fund? The third parameter will be a path to a file with the exact details. The format of the file will be as following: #aefud,nulrwher,nulrwher,nulrwher nmOFn0anaGotYa0anaGotYa1anaGotYa2… #aefud,nulrwher,nulrwher,nulrwher nmOFn1anaGotYa0anaGotYa1anaGotYa2… #aefud,nulrwher,nulrwher,nulrwher nmOFn2anaGotYa0anaGotYa1anaGotYa2… … The file contains the growth rate options of the different funds. You should go over all the funds and calculate the value of the account in its last year assuming the annual growth list of the specific fund. Choose the best fund ­ the best fund being the one that the value of it in the last year was the highest. If two funds return the same value, return the first one. You may assume that the form of the file is OK: Starts with #name and then a list of values separated by comma. If any error occur during the opening of the file (Can’t find the filename, bad reading due to wrong types) ­ Let Python print its default error and out (Will happen automatically) Complete the implementation of c o s _ e t f n ( a a y s v , u d _ i e hoebs_udslr,aefnsfl) Return a tuple containing the name of the chosen fund and the value of the retirement account in the last year (fund_name,account_value) Write your code in the appropriate place in the template. An example for funds_file is published on the website (link below), you can try the school solution with it. But, note that we will test you with different fund_files ­ Your code must deal with different number of funds. The length of all funds (number of years) would be the same, but you won’t know in advance this value. See more explanation in the template. Assignment 4 In this assignment you will play the investment advisor. You are asked to implement two missions: 4.1 A potential investor asks you what will be the growth rate in a...
View Full Document

This document was uploaded on 03/20/2014 for the course CMSC 67101 at Hebrew University of Jerusalem.

Ask a homework question - tutors are online