Advertisement
Guest User

rtrrer

a guest
Aug 3rd, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.15 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3. #include<cctype>
  4. #include<iomanip>
  5. using namespace std;
  6. class account
  7. {
  8.     char name[100];
  9.     char address[100];
  10.     char phone[100];
  11.     int id;
  12.     int pass;
  13.     char type[100];
  14.     int balance;
  15. public:
  16.     account ():balance(1000) { }
  17.     void create(int p);
  18.     void show();
  19.     void cheack_balance();
  20.     int checkid();
  21.     int ckpass();
  22.  
  23. };
  24.  
  25.  
  26.  
  27. void account::create(int p)
  28. {
  29.     cout<<"Inter your name..."<<endl;
  30.     cin.getline(name,100);
  31.     cout<<"Inter your address..."<<endl;
  32.     cin.getline(address,100);
  33.     cout<<"Inter your phone number..."<<endl;
  34.     cin.getline(phone,100);
  35.     cout<<"Inter your account type..."<<endl;
  36.     cin.getline(type,100);
  37.     cout<<"Inter your id"<<endl;
  38.     cin>>id;
  39.     cin>>pass;
  40.     cout<<endl<<endl<<"your password is:"<<pass<<endl;
  41.  
  42. }
  43.  
  44.  
  45. void account::show()
  46. {
  47.     cout<<endl<<endl<<"Your personal information is:"<<endl<<"..........................................."<<endl;
  48.     cout<<"Name:"<<name<<endl;
  49.     cout<<"Id:"<<id<<endl;
  50.     cout<<"Address:"<<address<<endl;
  51.     cout<<"Phone:"<<phone<<endl;
  52.     cout<<"Account type:"<<type<<endl<<endl<<endl;
  53. }
  54.  
  55.  
  56. void account::cheack_balance()
  57. {
  58.     cout<<endl<<endl<<endl<<"your current balance is: "<<balance<<endl<<endl;
  59. }
  60.  
  61. int account::checkid()
  62. {
  63.     return id;
  64. }
  65.  
  66. int account:: ckpass()
  67. {
  68.     return pass;
  69. }
  70.  
  71.  
  72.  
  73. int main()
  74. {
  75.     account obj[100];
  76.     int i=0;
  77.     while(1)
  78.     {
  79.         int t;
  80.         cout<<endl<<endl<<endl<<"...................Main menu................."<<endl;
  81.         cout<<"choose option......."<<endl;
  82.         cout<<"1.Register"<<endl;
  83.         cout<<"2.login"<<endl<<endl<<endl;
  84.         cin>>t;
  85.         if(t==1)
  86.         {
  87.             getchar();
  88.             obj[i].create(i);
  89.             i++;
  90.         }
  91.         else if(t==2)
  92.         {
  93.             int k,serial;
  94.             cout<<endl<<endl<<"Inter your id:"<<endl;
  95.             cin>>k;
  96.             int flag=0;
  97.             for(int j=0; j<i; j++)
  98.             {
  99.                 if(k==obj[j].checkid())
  100.                 {
  101.                     int pas;
  102.                     cout<<"Your password:"<<endl;
  103.                     cin>>pas;
  104.                     if(pas==obj[j].ckpass())
  105.                     {
  106.                         flag=1;
  107.                         serial=j;
  108.                     }
  109.                 }
  110.             }
  111.             if(flag==0)
  112.             {
  113.                 cout<<endl<<endl<<"Information does not valid"<<endl;
  114.             }
  115.             else
  116.             {
  117.                 cout<<endl<<endl<<"...........Next option..........."<<endl;
  118.                 cout<<"1.Deposit"<<endl;
  119.                 cout<<"2.Withdraw"<<endl;
  120.                 cout<<"3.Balance transfer"<<endl;
  121.                 cout<<"4.Check Balance"<<endl;
  122.                 cout<<"5.Account info"<<endl;
  123.                 cout<<"6.Update info"<<endl;
  124.                 cout<<"  Main menu   "<<endl;
  125.                 int op;
  126.                 cin>>op;
  127.             }
  128.             //obj[i].show();
  129.             // obj[i].cheack_balance();
  130.         }
  131.  
  132.         else
  133.         {
  134.             break;
  135.         }
  136.  
  137.  
  138.     }
  139.     return 0;
  140. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement