Question
Create a C# program that simulates a simple ATM (Automated Teller Machine) system. The program should allow users to perform the following operations: Check their
Create a C# program that simulates a simple ATM (Automated Teller Machine) system. The program should allow users to perform the following operations:
- Check their account balance.
- Deposit money into their account.
- Withdraw money from their account.
- Exit the ATM.
You should start by defining a class or structure to represent a bank account. Each account should have attributes like the account holder's name, account number, and balance.
Your program should provide a menu for users to select one of the operations above, and it should continue to prompt the user for actions until they choose to exit. Ensure that the program handles invalid inputs gracefully, such as attempting to withdraw more money than the account balance allows.
Example:
Welcome to the ATM! Please select an option: 1. Check Balance 2. Deposit 3. Withdraw 4. Exit Enter your choice: 1 Account balance: $1000.00 Enter your choice: 2 Enter the deposit amount: 500.50 Deposit successful. New balance: $1500.50 Enter your choice: 3 Enter the withdrawal amount: 700.00 Withdrawal successful. New balance: $800.50 Enter your choice: 3 Enter the withdrawal amount: 900.00 Insufficient funds. Current balance: $800.50 Enter your choice: 4 Thank you for using the ATM. Goodbye!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started