0% found this document useful (0 votes)
15 views

Bank Simulation

The document outlines instructions for creating a basic banking system in Python, including features like PIN verification, account balance management, and transaction options such as deposit, withdrawal, and balance checks. It specifies conditions for handling incorrect PIN attempts, negative amounts, and transaction limits, as well as additional functionalities like changing the PIN and transferring money. The program should allow multiple transactions until the user chooses to exit, while providing appropriate feedback for each action taken.

Uploaded by

tnourein
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Bank Simulation

The document outlines instructions for creating a basic banking system in Python, including features like PIN verification, account balance management, and transaction options such as deposit, withdrawal, and balance checks. It specifies conditions for handling incorrect PIN attempts, negative amounts, and transaction limits, as well as additional functionalities like changing the PIN and transferring money. The program should allow multiple transactions until the user chooses to exit, while providing appropriate feedback for each action taken.

Uploaded by

tnourein
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Write a Python program to simulate a basic banking

system.
Instructions:
● Set a 4 digit PIN number (e.g., 1234) – Assume the PIN already exists.
● Ask the user to enter the PIN:
○ If the PIN is incorrect, display an error message and stop the

program.
○ If the PIN is correct, display a menu with the following options:
◆ C. Check balance
◆ D. Deposit money
◆ W. Withdraw money
◆ E. Exit program
● Start the account balance at 0.
● Allow the user to perform multiple transactions until they choose to
exit.
● If the user chooses C, display the current balance.
● If the user chooses D:
○ prompt them to enter an amount and add it to the balance
○ display the new balance as “Deposit Successful. Your new balance

is $X”
● If the user chooses W:
○ If the withdrawal amount is more than the balance, display a

message like: "Insufficient funds. Your current balance is $X."


○ If the amount is valid, update the balance, display a message like:

“Withdrawal Successful. Your current balance is $X.”


● If the user chooses E, exit the program with a goodbye message.

Example Output:
Enter PIN: 1234
PIN correct.

Menu:
C - Check balance
D - Deposit money
W - Withdraw money
E - Exit

Enter option: D
Enter amount to deposit: $100
Deposit successful. New balance: $100

Enter option: W
Enter amount to withdraw: $150
Insufficient funds. Your current balance is $100.
Enter option: C
Your balance is $100.

Enter option: W
Enter amount to withdraw: $50
Withdraw successful. Your new balance: $50

Enter option: E
Exiting program. Goodbye!

Add-ons (only after the first part is done)


. Allow the user to enter the PIN up to three times if the initial attempt
is incorrect. If the user fails to enter the correct PIN after three
attempts, display a message like: "Too many incorrect attempts. Your
account is locked." and terminate the program.
. Prevent the user from depositing or withdrawing a negative amount
and display a clear error message if they try to do so
. Add an option in the menu to allow the user to change their PIN after
entering the correct one. Ensure that the new PIN is exactly 4 digits
and prompt the user to confirm the new PIN before changing it.
. Implement a feature that sets a maximum withdrawal limit per
transaction. Display an error message if the user tries to withdraw
more than the limit.
. Add an option to display the last five transactions (both deposits and
withdrawals) with their amounts and updated balances.
. Create an option that allows the user to transfer money to another
account. Ensure the transfer amount is not greater than the available
balance.
. Update the program to handle non-numeric inputs when the user
attempts to deposit or withdraw money, displaying an error message
and prompting for a valid input.

You might also like