C# program to demonstrate ATM transactions
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program:
The source code to demonstrate the ATM transaction in C# is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
In the above program, we created a class ATMDEMO that contains the Main() method. Here we created an ATM menu that provides the following options:
Here we take user input for ATM PIN, if ATM PIN is correct then we can use the above options.
Balance Enquiry:
Here we print the total balance of the user.
Cash Withdrawal:
Here we checked entered amount that should be multiple of 100, and check entered amount must be less than total balance, if both conditions are satisfied then we can withdraw the amount from ATM.
Deposit Cash:
Here we took amount as input and add to the total balance and then print total balance on the screen.
Exit:
This option is used to exit from ATM program.