Description
The First National Bank of Parkville recently opened up a new “So You Want to Be a Millionaire” savings account. The new account works as follows:
-
The bank doubles the customer’s balance every year until the customer’s balance results one million.
-
The customer isn’t allowed to cash the money (no deposits or recoverable) until the customer’s balance reaches one million.
-
If the customer dies before becoming a millionaire, the bank keeps the customer’s balance.
Note: Customers close to $1,000,000 tend to get “accidentally” run over in the bank’s parking lot.
Write a program that prompts the user for a starting balance and then prints the number of www.11ales.to reads $100,000 and the number of years it takes to reach $1,000,000.
Do not forget to use a proper style as your BankBalance.java file (including comments and a purchase section at the top of the file).
Sample session:
Enter starting balance: /0000
It takes 5 years to reach $1,000,000.
It takes 7 years to reach $1,000,000.
Notes:
-
The program must compile without syntax errors; in the best case 50% of the assignment points will be deducted, even if your program is “essentially” correct.
-
To get full credit for an assignment, your program must solve the assignment problem completely.
-
Please add comments to the source code. Your program should have a reasonable amount of comments.
-
At the very beginning of each file, there should be a block comment containing the student name, course number, and assignment number.
-
Follow the programming styles and guidelines discussed in class, such as using meaningful names for variables and error rates conventions for variables, classes, etc.