I want the below code modified that works for multi user in below code there are only one user but i need multi user up to 10? Code #include #include #include Using namespace std; class Bank...


I want the below code modified that works for multi user in below code there are only one user but i need multi user up to 10?




Code


#include


#include


#include


Using namespace std;


class Bank


{public:};


class ATMAccountHolders:Bank


{string accountHolders;


 string accountHoldersAddress, branch;


 int accountNumber;


 double startBalance;


 double accountBalance;


 double amount;


 int count;


Public:


  void deposit();


  void withdraw();


  void accountExit();


 ATMAccountHolders()


 {accountNumber = 7787;


  accountHolders = " Ammad Naseer";


  accountHoldersAddress = " House no.112";


  startBalance = 6000.00;


  accountBalance = 6000.00;


  branch = " Islamabad";


  amount = 20000;


 }


};


void ATMAccountHolders::deposit()


{ system("cls");


 cout<" atm="" account="" deposit="" system="">


 cout<"\n\nthe names="" of="" the="" account="" holders="" are=""><><>


 cout<"\tthe account="" holders'="" address="" is=""><><>


 cout<"\tthe branch="" location="" is=""><><>


 cout<"\taccount number=""><><>


 cout<"\tstarting account="" balance="" :rs.=""><><>


 cout<"\tpresent available="" balance="" :rs.=""><><>


 cout<"\tenter the="" amount="" to="" be="">


 double amount;


 cin>>amount;


 accountBalance=startBalance+amount ;


 cout<"\n\tyour new="" available="" balanced="" amount="" is=""><>


 cout<"\n\t\t\tthank><>


 cout<"press any="" key="" to="" return="" to="" the="" main="">


 system("PAUSE"); }


void ATMAccountHolders::withdraw()


{system("cls");


 cout<"\n\nthe names="" of="" the="" account="" holders="" are=""><><>


 cout<"\tthe account="" holders'="" address="" is=""><><>


 cout<"\tthe branch="" location="" is=""><><>


 cout<"\taccount number=""><><>


 cout<"\tpresent available="" balance=""><><>


 cout<"\tenter the="" amount="" to="" be="" withdrawn="">


 double amount;


 cin>>amount;


 if(amount>accountBalance||amount>20000)


 { system("cls");


  cout<"\n\tinsufficient available="" balance="" in="" your=""><>


  cout<"\t\t\tsorry><>


  system("PAUSE");


 }


 else


 double b;


 accountBalance=accountBalance-amount ;


 cout<"\n\nthe names="" of="" the="" account="" holders="" are=""><><>


 cout<"\tthe account="" holders'="" address="" is=""><><>


 cout<"\tthe branch="" location="" is=""><><>


 cout<"\taccount number=""><><>


 cout<"your new="" available="" balanced="" amount="" is=""><>


 cout<"press any="" key="" to="" return="" to="" the="" main="">


 system("PAUSE");}


void ATMAccountHolders::accountExit(){


 system("cls");


 cout<"\n\n\t\t brought="" to="" you="" by="" ammad="" naseer="" (sp20-bcs-156)="">


 system("PAUSE");


 exit(1);


}


int main()


{


 int e;


 //creating object of the class


 ATMAccountHolders p;


 //clearing the system screen


 system("cls");


 //setting the colour of the screen


 system ("Color 1f");


 //displaying the current date


 cout < "\t\tcurrent="" date="" :="">


 time_t now;


 time(&now);


 //displaying the time


 printf("%s\n", ctime(&now));;


 //Give space for the function of date and time


 cout<><>


 //displaying the menu


 cout<"\tpress 1="" and="" then="" press="" enter="" to="" access="" your="" account="" via="" pin="">


 cout<"\t\t\t\t\t or="">


 cout<"\tpress 0="" and="" press="" enter="" to="" get="">


 int access;


 cin>>access;


 switch(access)


 {


  //press 1 to access the account


  case 1://pin to access account


   system("cls");


   int i, pin;


   cout<"\n\nenter your="" acc="" pin="" access="" number!="" [only="" one="" attempt="" is=""><>


   cin>>pin;


   system("cls");


   //checking the entered pin and it should be only 12345


   if(pin==12345)



   {



    system("cls");





    do



    {



     //clearing the system screen



     system("cls");



     //displaying the menu



     cout < "\t\tenter="" [1]="" to="" deposit="" cash"=""><>



     cout < "\t\tenter="" [2]="" to="" withdraw="" cash"=""><>



     cout < "\t\tenter="" [0]="" to="" exit="" atm"="">< endl=""><>



     cout < "\tplease="" enter="" a="" selection="" and="" press="" return="" key:="">



     cin>>e;



     switch(e)



     {



      //option 1 for deposit operation and



      //it will call the deposit function



      case 1:



       p.deposit();



       break;



      //option 2 for withdraw operation and



      //it will call the withdraw function



      case 2:



       p.withdraw();



       break;



      //option 0 to exit



      case 0:



       p.accountExit();



       break;



      default:cout<"please enter="" the="" correct="" number=""><>



     }



    }while(e!=0);



    break;



   }



   //if the entered pin is wrong



   else



   {



    //clearing the screen



    system("cls");



    //



    cout<"\nyou had="" made="" your="" attempt="" which="" failed!!!="" no="" more="" attempts="" allowed!!="">



    system("PAUSE");



    exit (1);



   }



  //if the user wants help



  case 0:



   system("cls");





   cout<"\n\n\t\tbank representative="" for="" assistance="" during="" bank="" opening="">



   cout<"\t\tthanks for,="" your="" choice="">





   system ("PAUSE");



   exit(1);



   break;



 }



 system("PAUSE");



 return 0;



}

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here