27 Mart 2017 Pazartesi

QT BANK ATM TRANSACTION

#include "trans.h"
#include
Trans::Trans()
{
}
unsigned long amount=1000,deposit,withdraw;
int choice,pin,k;
char transaction='y';
void Trans::func()
{
    while(pin != 1520)
    {
        std::cout<<"\nPlease Your Secret PIN Number : ";
        std::cin>>pin;
        if(pin != 1520)
        {
            std::cout<<"\nPlease Enter Invalid Password";
        }
    }
    do
    {
        std::cout<<"*************Welcome to ATM Service \n";
        std::cout<<"1.Check Balance  \n";
        std::cout<<"2.Withdraw Cash  \n";
        std::cout<<"3.Deposit Cash   \n";
        std::cout<<"4.Quit           \n";
        std::cout<<"************?**\n\n";
        std::cout<<"Enter Your Choice\n";
        std::cin>>choice;
        switch (choice)
        {
        case 1:
            std::cout<<"\nYOUR BALANCE  : "<
            break;
       case 2:
            std::cout<<"\nPLEASE ENTER AMOUNT TO WITHDRAW:  ";
            std::cin>>withdraw;
            if(withdraw %100 !=0)
            {
                std::cout<<"\nPLEASE  ENTER AMOUNT IN MULTIPLES OF 100";
            }
            else if(withdraw>(amount-500))
            {
                std::cout<<"\n INSUFFICENT BALANCE";
            }
            else
            {
                amount=amount-withdraw;
                std::cout<<"\n PLEASE COLLECT CASH  :";
                std::cout<<"\n YOUR BALANCE IS : "<
            }
            break;
       case 3:
            std::cout<<"\nPLEASE ENTER AMOUNT TO DEPOSIT";
            std::cin>>deposit;
            amount=amount+deposit;
            std::cout<<"\nYOUR BALANCE : "<
      case 4:
            std::cout<<"\nTHANK YOU USING ATM ";
      default:
                std::cout<<"\n INVALID CHOICE";

      }
      std::cout<<"\n\n\nDO YOU WISH ANOTHER TRANSACTION?(y/n):\n";
      std::cin>>transaction;
      if(transaction == 'n' || transaction == 'N')
      {
          k=1;
      }
   }
    while(!k);
    std::cout<<"\n\nTHANKS FOR USING OUT ATM SERVICE";
    
}
Share: