Hello Guys! Welcome to my Blog!
Today we will implementing the HBL ATM MACHINE system on C#
This is Atm Machine Code
This Machine code works as a Credit And Deposit
The First Requirement in it Verified Your Pincode ,When your pincode is Verified ,It show your bankbalance..
Then you can perform your second option the second option that,
what action you want to perform !
credit or deposit You do whatever action you want to perform!
after credit or deposit this code show your history of transaction
C SHARP!
ATM MACHINE PROGRAM!
using System;using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
namespace HBL
{
class Program
{
int Bankbalance = 100000; //This is your Bnakbalance
void selection() //first method for information
{
Console.WriteLine("\t\t\t\t\tWELCOME TO OUR HBL BANK");
Console.WriteLine("\t\t\t\t\t ATM HBL MACHINE");
while (true)
{
Console.WriteLine("\n\nEnter Your Pin Code NOTE:IF YOU WANT TO EXIT TYPE 0");
int key = int.Parse(Console.ReadLine()); //First verify your code
if (key == 0)
{
break; //if user put 0 the program will be close
}
if (key == 1234) //this is your pincode
{
Console.WriteLine(key + " is Verified");
Console.WriteLine("\nYou Have "+ Bankbalance +" Ruppes In Your Account");//after verify its show your bankbalance
Console.WriteLine("\nWhat type of Action you Want to Perform!\n");
while (true)
{
Console.WriteLine("1:Credit \t 2:Deposit\n");
int choose = int.Parse(Console.ReadLine());
if (choose == 1)
{
credit(); //if user put 1 credit method will be execute
break;
}
else if (choose == 2)
{
deposit();//if user put 2 deposit method will be execute
break;
}
else //if user choose out of number it will tell you choose 1 or 2
{
Console.WriteLine("Please Choose 1 Or 2");
}
}
}
else
{
Console.WriteLine("Please Type Correct Pin Code");
} //if user put wrong pincode its show please type correct pincode
}
void credit() //second method for credit
{
int a = 500;
int b = 1000;
int c = 2000;
int d = 5000;
int e = 10000;
int f = 20000;
int g;
while (true)
{
Console.WriteLine("\n TRANSACTION");
Console.WriteLine("\n 1:500 \t\t 2:1000\n 3:2000 \t 4:5000\n 5:10,000 \t 6:20,000\n\t 7:MORE.."); //As the ATM Machine has option ,there are option here to credit.how much do you want to withdraw?
int cred = int.Parse(Console.ReadLine());
if (cred == 1)//this is 1st options condition of credit ,after selecting the option it gives you full information
{
Console.WriteLine(" WITH DRAWAL");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Bankbalance = Bankbalance - a;
Console.WriteLine("Your Remaining Balanace Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (cred == 2)
{
Console.WriteLine(" WITH DRAWAL");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Bankbalance = Bankbalance - b;Console.WriteLine("Your Remaining Balanace Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (cred == 3)
{
Console.WriteLine(" WITH DRAWAL");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Bankbalance = Bankbalance - c;
Console.WriteLine("Your Remaining Balanace Is " + Bankbalance );
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (cred == 4)
{
Console.WriteLine(" WITH DRAWAL");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Bankbalance = Bankbalance - d;
Console.WriteLine("Your Remaining Balanace Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (cred == 5)
{
Console.WriteLine(" WITH DRAWAL");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Bankbalance = Bankbalance - e;
Console.WriteLine("Your Remaining Balanace Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (cred == 6)
{
Console.WriteLine(" WITH DRAWAL");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Bankbalance = Bankbalance - f;
Console.WriteLine("Your Remaining Balanace Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (cred == 7)//7th option is that you can credit as you wish if you dont have to credit from these options
{
Console.WriteLine("How Many Rupees You Want to Credit?");
g = int.Parse(Console.ReadLine());
Console.WriteLine(" WITH DRAWAL");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Bankbalance = Bankbalance - g;
Console.WriteLine("Your Remaining Balanace Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else
{
Console.WriteLine(" PLEASE CHOOSE NUMBER UNDER 1 TO 7");
//if user choose out of number it will tell you choose 1 to 7
}
}
}
void deposit() //third method for deposit
{
int a = 10000;
int b = 20000;
int c = 30000;
int d = 40000;
int e = 50000;
int f = 60000;
int g;
while (true)
{
Console.WriteLine("\n TRANSACTION");
Console.WriteLine("\n 1:10,000 \t 2:20,000\n 3:30,000 \t 4:40,000\n 5:50,000 \t 6:60,000\n\t 7:MORE..");//As the ATM Machine has option ,there are option here to deposit.how much do you want to deposit?
int dep = int.Parse(Console.ReadLine());
if (dep == 1)//this is 1st options condition of deposit ,after selecting the option it gives you full information
{
Console.WriteLine("\tDEPOSIT");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Bankbalance = Bankbalance + a;
Console.WriteLine("After Deposit Now Your Balance Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (dep == 2)
{
Console.WriteLine("\tDEPOSIT");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Bankbalance = Bankbalance + b;
Console.WriteLine("After Deposit Now Your Balance Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (dep == 3)
{
Console.WriteLine("\tDEPOSIT");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
int depos = Bankbalance + c;
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Console.WriteLine("After Deposit Now Your Balance Is " + depos);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (dep == 4)
{
Console.WriteLine("\tDEPOSIT");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Bankbalance = Bankbalance + d;
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Console.WriteLine("After Deposit Now Your Balance Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (dep == 5)
{
Console.WriteLine("\tDEPOSIT");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Bankbalance = Bankbalance + e;
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Console.WriteLine("After Deposit Now Your Balance Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (dep == 6)
{
Console.WriteLine("\tDEPOSIT");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Bankbalance = Bankbalance + f;
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Console.WriteLine("After Deposit Now Your Balance Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else if (dep == 7)7th option is that you can deposit as you wish if you dont have to deposit from these options
{
Console.WriteLine("How Many Rupees You Want to deposit?");
g = int.Parse(Console.ReadLine());
Console.WriteLine("\tDEPOSIT");
Console.WriteLine("CARDNO:24356*****2435");
Console.WriteLine("ACCOUNT:2234*****2345");
Console.WriteLine(DateTimeOffset.Now);
Console.WriteLine("\nYour Current Balance Is " + Bankbalance);
Bankbalance = Bankbalance + g;
Console.WriteLine("Your Remaining Balanace Is " + Bankbalance);
Console.WriteLine("THANKYOU FOR USING HBL ATM");
break;
}
else//if user choose out of number it will tell you choose 1 to 7
{
Console.WriteLine(" PLEASE CHOOSE NUMBER UNDER 1 TO 7");
}
}
}
}
static void Main(string[] args)
{
Program obj = new Program();
obj.selection();//this object is made to execute first method
Console.ReadLine();
}
}
}
Nice Article 😊
ReplyDeleteVery nice program keep it up
ReplyDeleteMuch informative
ReplyDeleteAmazing work
ReplyDeleteHelpful indeed
ReplyDeleteKeep that work
ReplyDeleteAmazing
ReplyDelete