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:

  1. Check their account balance.
  2. Deposit money into their account.
  3. Withdraw money from their account.
  4. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!