| CMSC 201 |
Lab 10: Program DesignAssignmentFor this assignment you must design and implement a simple program to control a bank account. Your program will print a menu with the following options: 1) Deposit 2) Withdraw 3) View balance 4) Quit But, there are a few other rules! Rule 1: The account must have at least $5.00 in it. If the balance ever dips below $5 the bank will close the account and the program will exit. Rule 2: If the account ever has above $500.00 you need to calculate interest. Your bank gets 1% interest so to calculate the interest just add 1% of the current balance to the current balance. If the current balance was $100.00, you would find 1% of 100 ($1) and add it to the balance. The new current balance is $101.00. Rule 3: If the balance in the account is ever exactly $1337.00 you get robbed of all your money and the program exits Rule 4: (last rule, don't worry!) You must use at least 6 functions besides main (meaning main does NOT count as 1 of the 6 functions). This may sound like a lot, but most of them are very easy! The menu even gives you the first 3! (or the first 4 if you think about it) To make things easier, start your balance off at $100.00. Running your program should look something like this: 1) Deposit 2) Withdraw 3) View balance 4) Quit Enter menu option: 1 How much would you like to deposit? 999.0 Your new balance is $1099.00 Since you had more than $500.00 you get interest! Your new balance is $1109.99 1) Deposit 2) Withdraw 3) View balance 4) Quit Enter menu option: 2 How much would you like to withdraw? 1109.0 Your new balance is $0.99 You're broke!! We're kicking you out of the bank Final total is $0.99 Note: You do NOT have to match the given output exactly. These are just guidelines to get you going in the right direction. We want you to understand the design/logic of the program, so as long as the logic is correct the output isn't important. Also, make sure you print the current balance anytime a change is made (deposit/withdrawal/interest/etc) |