C Program for HNB
ATM Machine
DCSD 15.2
Group 5
Introduction
•Mission: Building a C program to an ATM machine by
using our C Programming Knowledge.
•Vision: Enhancing C programming know how in
operating in ATM machines.
Background to the Project
•Achieving the current issues and global issues.
•Be practical in our day today world.
•Co-op with the modern world.
•Dealing with novel technical knowhow.
•Enhancing team spirits and sharing knowledge.
•Achieving the ultimate goals of our study area.
Aims & Objectives
• Enhancing ICT know how in manipulating ATM
machines.
• Awareness of progress of each and every component
given to the group.
• Understanding the shortcoming or drawbacks and
taking remedial measures.
• Proving the knowledge obtained practically.
• Getting students activity engaged in activities related
ICT.
• Marking the learning outcomes positive & reach the
ultimate goal.
• Understanding global issues. Cooperating up with
current friends.
• Cooperating up with current friends.
Aims & Objectives
What is an ATM Machine?
An Automated Teller Machine (ATM) is an electronic
banking outlet, which allows customers to complete basic
transaction without the aid of a branch representative or a
teller
ATM Card
An ATM card is any payment issued by a financial
institution that enables a customer to access an ATM
machine in order to perform transaction.
Advantages
• Can use ATM machines at any time without accessing into
a bank.
• ATMs offer the convenience of multiple locations.
• Your ATM card is protected by a PIN.
• You don’t need to fill out any slips to do your task.
• ATMs are faster than going to the bank – no long lines.
• One can withdraw cash at ATMs in foreign countries.
Disadvantages
•There must be system down failures.
•You might forget your PIN number.
•Risk of robbery when you leave the ATM.
•Fees charge to use ATMs of other banks can become
expensive.
The Source Code
The first page
printf("tttEnter your PIN:");
scanf("%d",&pin);
do{
if (pin==12345)
{
start(a);
printf("tttSelect you operation: ");
scanf("%d",&a);
;
else
{
if (i<4)
{printf("ttEnter valid PIN!n");
Enter your pin:
do{
if (pin==12345)
{
start(a);
printf("tttSelect your operation: ");
scanf("%d",&a);
}
else
{
if (i<4)
{printf("ttEnter valid PIN!n");
return main();}
else
{ printf("nn************* Your card
has been blocked! ******************");
continue;}
return 0;
}
Calling the Start
function
*******************your card has been blocked******************
void start(int a)
{
printf("*******************************************************************n");
printf(" Welcome to HNB ATM service!n");
printf("nn---------------------DCSD 15.2 GROUP 5-------------------------nn");
printf("*******************************************************************n");
printf("ttt1.Check amount.n");
printf("ttt2.Withdraw money.n");
printf("ttt3.Deposit money.n");
printf("ttt4.Transfer money.n");
printf("ttt5.Exit.n");
printf("*******************************************************************n");
The start function
************************************************************
Welcome to HNB ATM service!
-------------DCSD 15.2 GROUP 5---------------
************************************************************
1.check the amount
2.withdraw money
3.Deposit money.
4.Transfer money.
5.Exit
************************************************************
*
Select your operation:
.....................
void print()
{
int blink;
printf("please wait....n");
for(blink=0;blink<7;blink++)
}
printf("....");
usleep(350000);}
}
Special
function
print
Please wait.........
void start(int a);
void print();
float b=200000;
int i=1;
Initial Balance
Declaring global variables
int main()
{
int a=0,pin=0;
int acc_no=0;
char m,M;
float w=0,d=0,t=0;
i=i+1;
Declaring the local variables
switch(a)
{
case 1:
print();
printf("ntYour current balance is: Rs.%.2f",b);
break;
case 2:
print();
printf("ntEnter amount:");
scanf("%f",&w);
if(w<b&&b>500)
{b=b-w;
print();
printf("nttttPlease collect your cash..!n");
printf("ttCurrent balance is:Rs.%.2f",b);}
else
{
printf("nttttInsufficient balance!");
}
break;
Your current balance is: Rs.200000.00
new operation ? (y/n):
Please wait..................................
Enter amount:100000
Please wait................................
Please collect your cash..
Your current balance is: Rs. 100000.00
New operation ? (y/n)
Enter amount: 500000
Insufficient balance !
new operation ? (y/n):
case 3:
print();
printf("nttEnter amount:");
scanf("%f",&d);
{b=b+d;
printf("nttYour current balance is: Rs.%.2f",b);}
break;
Enter amount: 100000
Your current balance is :Rs.300000.00
new operation ? (y/n):
case 4:
print();
printf("nttEnter Transfer Code:");
scanf("%d",&acc_no);
if(100000<acc_no&&acc_no<999999)
{
printf("nttEnter amount:");
scanf("%f",&t);
if(t<b && b>500)
{ b=b-t;
print();
printf("ntttTransfer is successful!n");
printf("tttYour current balance is: Rs.%.2fn",b);
}
else
{
printf("nttttInsufficient balance.!");
}
}
else
{
printf("nttttInvalid Transfer Code! n");}
break;
Enter the amount:
Enter recipient acc no:
...................
100000
Your current balance is :Rs.100000.00
123456
Please wait.................
New opeeration ? (y/n):
case 5:
print();
printf("ntttttThank you !n");
return 0;
default:
printf("nttttNo function!");
}
printf("nttNew operation?(n/y):");
scanf("%s",&M);
if (M=='n')
break;
}while (M=='y');
printf("nnntttThank you!n");
printf("nttttDo you want to exit?
(y/n)");
scanf("%s",&m);
if (m=='n')
{
return main(1);
}
else if (m=='y')
{
return 0;
}
return 0;
}
Group MembersGroup Members
M.K.P.U. Maddumage DG15230
Suriyaarachchi P. Y DG15251
N.V. Haththotuwa DG15216
Ravindu M.H. S DG15246
Prabhashwara.C.S. S DG15243
I.K.L. Madushanka DG15233
D.P.N. Senevirathna DG15250
C program for hnb atm machine   original - updated - [pys]

C program for hnb atm machine original - updated - [pys]

  • 1.
    C Program forHNB ATM Machine DCSD 15.2 Group 5
  • 2.
    Introduction •Mission: Building aC program to an ATM machine by using our C Programming Knowledge. •Vision: Enhancing C programming know how in operating in ATM machines.
  • 3.
    Background to theProject •Achieving the current issues and global issues. •Be practical in our day today world. •Co-op with the modern world. •Dealing with novel technical knowhow. •Enhancing team spirits and sharing knowledge. •Achieving the ultimate goals of our study area.
  • 4.
    Aims & Objectives •Enhancing ICT know how in manipulating ATM machines. • Awareness of progress of each and every component given to the group. • Understanding the shortcoming or drawbacks and taking remedial measures. • Proving the knowledge obtained practically.
  • 5.
    • Getting studentsactivity engaged in activities related ICT. • Marking the learning outcomes positive & reach the ultimate goal. • Understanding global issues. Cooperating up with current friends. • Cooperating up with current friends. Aims & Objectives
  • 6.
    What is anATM Machine? An Automated Teller Machine (ATM) is an electronic banking outlet, which allows customers to complete basic transaction without the aid of a branch representative or a teller
  • 7.
    ATM Card An ATMcard is any payment issued by a financial institution that enables a customer to access an ATM machine in order to perform transaction.
  • 8.
    Advantages • Can useATM machines at any time without accessing into a bank. • ATMs offer the convenience of multiple locations. • Your ATM card is protected by a PIN. • You don’t need to fill out any slips to do your task. • ATMs are faster than going to the bank – no long lines. • One can withdraw cash at ATMs in foreign countries.
  • 9.
    Disadvantages •There must besystem down failures. •You might forget your PIN number. •Risk of robbery when you leave the ATM. •Fees charge to use ATMs of other banks can become expensive.
  • 10.
  • 11.
    The first page printf("tttEnteryour PIN:"); scanf("%d",&pin); do{ if (pin==12345) { start(a); printf("tttSelect you operation: "); scanf("%d",&a); ; else { if (i<4) {printf("ttEnter valid PIN!n"); Enter your pin:
  • 12.
    do{ if (pin==12345) { start(a); printf("tttSelect youroperation: "); scanf("%d",&a); } else { if (i<4) {printf("ttEnter valid PIN!n"); return main();} else { printf("nn************* Your card has been blocked! ******************"); continue;} return 0; } Calling the Start function *******************your card has been blocked******************
  • 13.
    void start(int a) { printf("*******************************************************************n"); printf("Welcome to HNB ATM service!n"); printf("nn---------------------DCSD 15.2 GROUP 5-------------------------nn"); printf("*******************************************************************n"); printf("ttt1.Check amount.n"); printf("ttt2.Withdraw money.n"); printf("ttt3.Deposit money.n"); printf("ttt4.Transfer money.n"); printf("ttt5.Exit.n"); printf("*******************************************************************n"); The start function
  • 14.
    ************************************************************ Welcome to HNBATM service! -------------DCSD 15.2 GROUP 5--------------- ************************************************************ 1.check the amount 2.withdraw money 3.Deposit money. 4.Transfer money. 5.Exit ************************************************************ * Select your operation:
  • 15.
    ..................... void print() { int blink; printf("pleasewait....n"); for(blink=0;blink<7;blink++) } printf("...."); usleep(350000);} } Special function print Please wait.........
  • 16.
    void start(int a); voidprint(); float b=200000; int i=1; Initial Balance Declaring global variables
  • 17.
    int main() { int a=0,pin=0; intacc_no=0; char m,M; float w=0,d=0,t=0; i=i+1; Declaring the local variables
  • 18.
    switch(a) { case 1: print(); printf("ntYour currentbalance is: Rs.%.2f",b); break; case 2: print(); printf("ntEnter amount:"); scanf("%f",&w); if(w<b&&b>500) {b=b-w; print(); printf("nttttPlease collect your cash..!n"); printf("ttCurrent balance is:Rs.%.2f",b);} else { printf("nttttInsufficient balance!"); } break; Your current balance is: Rs.200000.00 new operation ? (y/n): Please wait.................................. Enter amount:100000 Please wait................................ Please collect your cash.. Your current balance is: Rs. 100000.00 New operation ? (y/n) Enter amount: 500000 Insufficient balance ! new operation ? (y/n):
  • 19.
    case 3: print(); printf("nttEnter amount:"); scanf("%f",&d); {b=b+d; printf("nttYourcurrent balance is: Rs.%.2f",b);} break; Enter amount: 100000 Your current balance is :Rs.300000.00 new operation ? (y/n):
  • 20.
    case 4: print(); printf("nttEnter TransferCode:"); scanf("%d",&acc_no); if(100000<acc_no&&acc_no<999999) { printf("nttEnter amount:"); scanf("%f",&t); if(t<b && b>500) { b=b-t; print(); printf("ntttTransfer is successful!n"); printf("tttYour current balance is: Rs.%.2fn",b); } else { printf("nttttInsufficient balance.!"); } } else { printf("nttttInvalid Transfer Code! n");} break; Enter the amount: Enter recipient acc no: ................... 100000 Your current balance is :Rs.100000.00 123456 Please wait................. New opeeration ? (y/n):
  • 21.
    case 5: print(); printf("ntttttThank you!n"); return 0; default: printf("nttttNo function!"); } printf("nttNew operation?(n/y):"); scanf("%s",&M); if (M=='n') break; }while (M=='y'); printf("nnntttThank you!n"); printf("nttttDo you want to exit? (y/n)"); scanf("%s",&m); if (m=='n') { return main(1); } else if (m=='y') { return 0; } return 0; }
  • 23.
    Group MembersGroup Members M.K.P.U.Maddumage DG15230 Suriyaarachchi P. Y DG15251 N.V. Haththotuwa DG15216 Ravindu M.H. S DG15246 Prabhashwara.C.S. S DG15243 I.K.L. Madushanka DG15233 D.P.N. Senevirathna DG15250