Q.A bank is a financial institution which is involved in borrowing and lending of money. With advancement in technology, online banking, also known as internet banking allows customers of a bank to conduct a range of financial transactions through the bank’s website anytime, anywhere. As part of initial investigation you are suggested to
• collect a bank’s application form. After careful analysis of the form, identify the information required for opening a savings account. Also enquire about the rate of interest offered for a saving account.
• The basic two operations performed on an account are Deposit and Withdrawal. Write a menu driven program that accepts either of the two choices of Deposit and Withdrawal, then accepts an amount, performs the transaction and accordingly displays the balance. Remember, every bank has a requirement of minimum balance which needs to be taken care of during withdrawal operations. Enquire about the minimum balance required in your bank.
• Collect the interest rates for opening a fixed deposit in various slabs in a savings bank account. Remember, rates may be different for senior citizens.
Finally, write a menu driven program having the following options (use functions and appropriate data types):
• Open a savings bank account
• Deposit money
• Withdraw money
• Take details, such as amount and period for a Fixed Deposit and display its maturity amount for a particular customer.
Keep accounts in a dictionary, write one function per banking operation, run them from a menu loop; withdrawals respect the minimum balance and FD maturity uses annual compounding with a senior-citizen bonus rate.
The idea. The investigation part of this case study (collecting an account-opening form, the interest-rate card and the minimum-balance rule from a real bank) feeds the constants of the program; the code itself is a classic menu-driven design. A dictionary keyed by account number holds [name, age, balance] (a list, because the balance must change). Each operation is a user-defined function so the menu stays a thin dispatcher.
Important honesty note: the rates and minimum balance below are illustrative example values — the question explicitly asks you to enquire at your own bank and substitute the real figures.
Program:
MIN_BALANCE = 1000 # example value - enquire at your own bank
FD_RATES = {1: 6.0, 3: 6.5, 5: 7.0} # example slabs: years -> % per annum
SENIOR_BONUS = 0.5 # extra % per annum for senior citizens (example)
accounts = {} # account_no -> [name, age, balance]
next_acc = 1001
def open_account():
global next_acc
name = input("Account holder's name: ")
age = int(input("Age: "))
amount = float(input("Initial deposit: "))
accounts[next_acc] = [name, age, amount]
print("Account", next_acc, "opened for", name, "with balance", amount)
next_acc = next_acc + 1
def deposit():
acc = int(input("Account number: "))
if acc not in accounts:
print("No such account")
return
amount = float(input("Amount to deposit: "))
accounts[acc][2] = accounts[acc][2] + amount
print("New balance:", accounts[acc][2])
def withdraw():
acc = int(input("Account number: "))
if acc not in accounts:
print("No such account")
return
amount = float(input("Amount to withdraw: "))
if accounts[acc][2] - amount < MIN_BALANCE:
print("Denied: balance cannot go below the minimum balance of", MIN_BALANCE)
else:
accounts[acc][2] = accounts[acc][2] - amount
print("New balance:", accounts[acc][2])
def fixed_deposit():
acc = int(input("Account number: "))
if acc not in accounts:
print("No such account")
return
amount = float(input("FD amount: "))
years = int(input("Period in years (1/3/5): "))
rate = FD_RATES[years]
if accounts[acc][1] >= 60: # senior citizen gets a higher rate
rate = rate + SENIOR_BONUS
maturity = amount * (1 + rate / 100) ** years # annual compounding
print("Rate applied:", rate, "% per annum")
print("Maturity amount after", years, "years:", round(maturity, 2))
while True:
print()
print("1.Open account 2.Deposit 3.Withdraw 4.Fixed Deposit 5.Exit")
choice = input("Enter choice: ")
if choice == '1':
open_account()
elif choice == '2':
deposit()
elif choice == '3':
withdraw()
elif choice == '4':
fixed_deposit()
elif choice == '5':
print("Thank you for banking with us!")
break
else:
print("Invalid choice")
Sample session:
1.Open account 2.Deposit 3.Withdraw 4.Fixed Deposit 5.Exit
Enter choice: 1
Account holder's name: Anita
Age: 65
Initial deposit: 50000
Account 1001 opened for Anita with balance 50000.0
1.Open account 2.Deposit 3.Withdraw 4.Fixed Deposit 5.Exit
Enter choice: 2
Account number: 1001
Amount to deposit: 10000
New balance: 60000.0
1.Open account 2.Deposit 3.Withdraw 4.Fixed Deposit 5.Exit
Enter choice: 3
Account number: 1001
Amount to withdraw: 59500
Denied: balance cannot go below the minimum balance of 1000
1.Open account 2.Deposit 3.Withdraw 4.Fixed Deposit 5.Exit
Enter choice: 3
Account number: 1001
Amount to withdraw: 5000
New balance: 55000.0
1.Open account 2.Deposit 3.Withdraw 4.Fixed Deposit 5.Exit
Enter choice: 4
Account number: 1001
FD amount: 50000
Period in years (1/3/5): 5
Rate applied: 7.5 % per annum
Maturity amount after 5 years: 71781.47
1.Open account 2.Deposit 3.Withdraw 4.Fixed Deposit 5.Exit
Enter choice: 5
Thank you for banking with us!
Key lines:
- The minimum-balance guard:
if accounts[acc][2] - amount < MIN_BALANCE:— the withdrawal of 59500 was denied because it would leave less than 1000, and a later 5000 withdrawal passed. - The FD maturity uses yearly compound interest in plain arithmetic:
maturity = amount * (1 + rate / 100) ** years. Anita is 65, so the 5-year slab rate 7.0 gets the senior bonus 0.5 -> 7.5 percent, and 50000 grows to 71781.47. global next_accletsopen_account()hand out sequential account numbers.
Store the age at opening so rate decisions (senior citizen or not) never need re-asking; in a fuller system you would store date of birth instead.
The menu program opens accounts, deposits, enforces the minimum balance on withdrawal, and computes FD maturity as amount times (1 + rate/100) to the power years — sample: 50000 for 5 years at 7.5 percent (senior rate) matures to 71781.47.
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.