This repository contains an interactive command-line project:
- ATM Machine: A simple ATM simulator that allows users to check balance, deposit, withdraw, and change their PIN.
- Clone the repository to your local machine.
- Navigate to the directory where you cloned it.
- Run the provided Python scripts in your terminal.
- Follow the prompts in each script to interact with the programs.
control_flow_atm.py: Contains the ATM Machine simulation.
- Python
If you find this project interesting and want to add new features, improve existing functionality, or fix any issues, your contributions are more than welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with clear, concise messages.
- Push your branch and create a pull request for review.
You can contact me Grace
- Strengthen control flow through nested conditions.
- Practice variable manipulation, loops, and functions.
- Implement enhanced user security and transaction tracking.
- Create a variable
balanceto hold the user’s account balance (e.g., 5000). - Set up a
pinvariable (e.g., 1234) for the user’s ATM PIN.
- Prompt the user to enter their PIN.
- Allow only three attempts if the PIN does not match; if all attempts are incorrect, exit with the message: "Too many incorrect attempts. Access blocked."
- If the PIN matches, proceed to the main menu.
After successful PIN entry, display a menu with options:
- Check Balance
- Deposit Funds
- Withdraw Funds
- Change PIN
- Exit
- Use a loop to allow the user to return to the main menu until they choose to exit.
- Check Balance: Display the current balance.
- Deposit Funds: Prompt the user to enter a deposit amount.
- Allow only positive numbers; update and display the new balance.
- Withdraw Funds: Prompt the user to enter a withdrawal amount.
- Ensure the amount is positive and doesn’t exceed the balance.
- Display an error if the balance is insufficient; otherwise, update and display the new balance.
- Change PIN:
- Prompt the user to enter the current PIN.
- If it matches, allow them to set a new 4-digit PIN.
- Confirm the new PIN by asking them to enter it again.
- Ensure all user inputs (amounts and PINs) are valid integers.
- Include error messages and re-prompts for invalid entries.
- Thank the user upon exit and display a summary of the total deposits and withdrawals during the session.
