problemset2

problemset2 - Introduction to Computers and Engineering...

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

View Full Document Right Arrow Icon
1.00 / 1.001 Fall 2005 Problem Set 2 Due: 11AM, Friday September 23, 2005 Banking & Investment [100 points] Introduction Since the stock markets and other types of investment are relatively difficult to model, we’ll be modeling investments as bank accounts. For the purposes of this problem set, we’ll assume there are only three types of investment accounts, tabulated below. Investment Type TYPE 1 TYPE 2 TYPE 3 Minimum Investment $0 $3,000 $5,000 Minimum Investment Period No limit 60 months (5 years) No limit Withdrawal Limit No limit $2,000 No limit Withdrawal Penalties No penalties $500 No penalities A TYPE 1 account has a monthly interest rate of 0.2466% (3% annually). For TYPE 2 accounts, the interest rate varies with the age of the account, as shown below. Account Age in months 0 – 12 13 – 36 37 to 60 > 60 Monthly Rate (Yearly Rate) 0.1162% (2%) 0.2060% (2.5%) 0.2871% (3.5%) 0.4074% (5%) The rate for TYPE 3 accounts is a random number between 0% and 0.7974% monthly (10% annually) and changes at the beginning of each month. To generate a random number (double) greater than or equal to zero, but less than 1, use Math.random() . For example, the code fragment below generates a random number greater than or equal to 2, but less than 6. double rand = 2 + 4 * Math.random(); For all account types, the interest is calculated at month-end on the total value of the investment. The interest is added to the total value of the investment. Interest = Old Total × Rate/100
Background image of page 1

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

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

This note was uploaded on 11/29/2011 for the course CIVIL 1.00 taught by Professor Georgekocur during the Spring '05 term at MIT.

Page1 / 4

problemset2 - Introduction to Computers and Engineering...

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

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