ATM software | ATM proper software in c++ | ATM operating system in C++

// Don't remove these line for legal use
// Upload on Let's programming by (CEO)
// For more contact
// key_to_programming@yahoo.com
 

#include <iostream>
using namespace std;

void main ()
{
       int balance=1000; // balance in account
       char test='y'; // for loop 1
       int newbalance;
       int withdraw;
       int transfer;
             cout<<"\t\t....ATM....\n\n";
       while (test=='y' || test =='Y')

       { // loop 1 start here
             int input;
                          
                           for (int i=1; i<=2;) // for repeat the manu if user input other than 123.
                           {
                           cout<<"\n1.\tCash Withdrowal"<<endl;
                           cout<<"2.\tBalance Tranfer"<<endl;
                           cout<<"3.\tBalance Inquiry"<<endl<<endl;
                           cout<<"Enter you selection: ";
                           cin>>input;

                           if (input ==1 || input ==2 || input ==3)
                                 break;
                           else
                                 cout<<"\nYou can only enter from given manu......"<<endl;
             }



             if (input==1)
             { // if for withdraw some amount

                    cout<<"Please enter the amount to withdraw: ";
                    cin>>withdraw;

                                         if (withdraw > balance)
                                                cout<<"Insufficient funds";

                                          else if (withdraw == 0)
                                                cout<<"You enter zero amount to withdraw"<<endl;
                                         else if (withdraw < 0)
                                                cout<<"You enter a amount less than zero"<<endl;
                                
                                         else
                                         {
                                                newbalance=balance-withdraw;
                                                cout<<"\nYour new balacne is: "<<newbalance<<endl;
                                         }

             }
             else if (input == 2)
             {
                    cout<<"\nPlease enter the amount to transfer: ";
                    cin>>transfer;
                    newbalance=balance-transfer;

                                                             if (transfer > balance)

                                                             cout<<"Insufficient funds";

                                                       else if (transfer == 0)
                                                             cout<<"You enter zero amount to transfer"<<endl;
                                                      else if (transfer < 0)
                                                             cout<<"You enter a amount less than zero"<<endl;
                                
                                                      else
                                                      {
                                                             newbalance=balance-transfer;

                                                             cout<<"\nPlease enter the Recipient's account number: ";
                                                             int act;
                                                             cin>>act; // only for accept acount number

                                                             cout<<"\nYour money is sent to entered recipient....!"<<endl;
                                                             cout<<"\nYour new balacne is: "<<newbalance<<endl;
                                                     }
             }

             else if (input==3)
                    cout<<"\nSir... you current balance is: "<<newbalance<<endl;
             else
                    ;

             cout<<"\nDo you want to do another transaction (y/n) :"; // for yes or no
             cin>>test;

       }// loop 1 end here

} // main end here
// Don't remove these line for legal use
// Upload on Let's programming by (CEO)
// For more contact
// key_to_programming@yahoo.com

Comments

Popular posts from this blog

Umbrella activities in Software Engineering

Operating System | Best Definition of Opetating System