Bank Simulation
Bank Simulation
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
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!