Saturday, December 16, 2023

BANK ATM PROCESS IN C

 ATM MACHINE WORKING PROCESS WITH SIMPLE CONTENT 

I this program we are use if else and the while loop statement .because when the  process was over in the ATM it will ask to continue or close is the real-time one . Which Comes to the programming the repeated process is called a looping∞.  Looping Statements are [while,do While,for].Now we use while loop in this project. And if and else was the process to take the responsibility for the true and false values or conditions. 


// bank atm machine 

#include<stdio.h>

void main()

}  

        int c_p_n= 1234,p_n ,choice,nw_pin,op=1;

//first defaultly set the pin.

float e_amt,sav_amt,w_amt,d_amt;

sav_amt=80000;

//set the amount in savings its used to calculations for the function. 

system("color 1B");// only for output windows color configurations 

printf(" -------------         Ak Binary BANK        --------------------");

printf("\n");

printf("Enter your pin number  :");

scanf("%d",&p_n);

if(c_p_n==p_n)

{

printf(" 1.CASH WITHDRWAL.\n");

printf(" 2.CASH DEPOSITE.\n");

printf(" 3.BALANCE ENQUIRE.\n");

printf(" 4.PIN NO CHANGE\n");

while(op!=2)😵

//  in While when the condition was false the program will exit or stop the process repeatation. 

{

printf(" select your choice :");

scanf("%d",&choice);

if( choice==1)

// same process if the condition was not ok if will execute the else itself. But while will only fully  exit  from the compilation. 

{

printf(" YOU SELECT THE WITHDRWAL OPTION \n");

printf("Enter the amount :");

scanf("%f",&e_amt);

if(e_amt<=sav_amt)

//in this place we note and understand one thing.withdrwal is the condition which means withdrawal amount was lesser than are equal to the saving amount is the possibility to do the process withdrawal so we want to declare the condition. 💸

{

w_amt=sav_amt-e_amt;

printf("------------withdrwal successfully--------------\n");

printf("Available balance :%.3f\t",w_amt);

sav_amt=w_amt;

}

else

{

printf ("insufficent fund");

}

}

else if(choice==2)

{

printf("YOU SELECT THE DEPOSITE OPTION\n");

printf("Enter the amt :");

scanf("%f",&e_amt);

d_amt=sav_amt+e_amt;

printf("---------------deposite successfully--------------------\n");

printf("Available balance in your account  :%.4f",d_amt);

sav_amt=d_amt;

}

else if( choice==3)

{

printf(" YOU SELECT THE BALANCE ENQUIRE OPTION\n");

printf("YOUR AVAILABLE BALANCE  IN YOUR ACOUNT :%.f\t",sav_amt);

}

else if( choice==4)

{

printf(" YOU SELECT THE PIN NUMBER CHANGING OPTION\n");

printf("Enter your new pin:");

scanf("%d",&nw_pin);

c_p_n=nw_pin;

//when the new pin was changed the old pin  is now  replacing that pin after this process. so then  we need a declaration to said the new one is now a old one .so old one's pin replacing the new one.

printf(" YOUR pin changed successfully\n");

printf("Your new pin number :%d\n",c_p_n);

}

printf("\n--------DO YOU WANT TO CONTINUE ----------\n  1= YES ,2= NO");

// the while looping Enter looping Statements conditions values access by two kind of functions they are 1 yes and 2 no .user select 1 yes the 1 will check by while .

scanf("%d",&op);

}

}

else{

("INVALID PIN NUMBER\n");

}

}

___________________________________________________________

OUTPUT:

------------- Ak Binary BANK --------------------

Enter your pin number :1234

 1.CASH WITHDRWAL.

 2.CASH DEPOSITE.

 3.BALANCE ENQUIRE.

 4.PIN NO CHANGE

 select your choice :1

 YOU SELECT THE WITHDRWAL OPTION

Enter the amount :10000

------------withdrwal successfully--------------

Available balance :70000.000

--------DO YOU WANT TO CONTINUE ----------

  1= YES ,2= NO

___________________________________________________________

YOU SELECT THE WITHDRWAL OPTION

Enter the amount :100000

insufficent fund

--------DO YOU WANT TO CONTINUE ----------

  1= YES ,2= NO

___________________________________________________________

select your choice :2

YOU SELECT THE DEPOSITE OPTION

Enter the amt :10000

---------------deposite successfully--------------------

Available balance in your account :80000.0000

--------DO YOU WANT TO CONTINUE ----------

  1= YES ,2= No

__________________________________________________________

select your choice :3

 YOU SELECT THE BALANCE ENQUIRE OPTION

YOUR AVAILABLE BALANCE IN YOUR ACOUNT :80000

--------DO YOU WANT TO CONTINUE ----------

  1= YES ,2= NO

__________________________________________________________

select your choice :4

 YOU SELECT THE PIN NUMBER CHANGING OPTION

Enter your new pin:3698

 YOUR pin changed successfully

Your new pin number :3698


--------DO YOU WANT TO CONTINUE ----------

  1= YES ,2= NO


#when user select 2 the value was not take a true value for the while condition so the program will exit.


No comments:

Post a Comment

DDL command in sql

DATA DEFINITION LANGUAGE DBMS language database language are used to read,update and store data in a database.There are several suc...