Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- #include<cctype>
- #include<iomanip>
- using namespace std;
- class account
- {
- char name[100];
- char address[100];
- char phone[100];
- int id;
- int pass;
- char type[100];
- int balance;
- public:
- account ():balance(1000) { }
- void create(int p);
- void show();
- void cheack_balance();
- int checkid();
- int ckpass();
- };
- void account::create(int p)
- {
- cout<<"Inter your name..."<<endl;
- cin.getline(name,100);
- cout<<"Inter your address..."<<endl;
- cin.getline(address,100);
- cout<<"Inter your phone number..."<<endl;
- cin.getline(phone,100);
- cout<<"Inter your account type..."<<endl;
- cin.getline(type,100);
- cout<<"Inter your id"<<endl;
- cin>>id;
- cin>>pass;
- cout<<endl<<endl<<"your password is:"<<pass<<endl;
- }
- void account::show()
- {
- cout<<endl<<endl<<"Your personal information is:"<<endl<<"..........................................."<<endl;
- cout<<"Name:"<<name<<endl;
- cout<<"Id:"<<id<<endl;
- cout<<"Address:"<<address<<endl;
- cout<<"Phone:"<<phone<<endl;
- cout<<"Account type:"<<type<<endl<<endl<<endl;
- }
- void account::cheack_balance()
- {
- cout<<endl<<endl<<endl<<"your current balance is: "<<balance<<endl<<endl;
- }
- int account::checkid()
- {
- return id;
- }
- int account:: ckpass()
- {
- return pass;
- }
- int main()
- {
- account obj[100];
- int i=0;
- while(1)
- {
- int t;
- cout<<endl<<endl<<endl<<"...................Main menu................."<<endl;
- cout<<"choose option......."<<endl;
- cout<<"1.Register"<<endl;
- cout<<"2.login"<<endl<<endl<<endl;
- cin>>t;
- if(t==1)
- {
- getchar();
- obj[i].create(i);
- i++;
- }
- else if(t==2)
- {
- int k,serial;
- cout<<endl<<endl<<"Inter your id:"<<endl;
- cin>>k;
- int flag=0;
- for(int j=0; j<i; j++)
- {
- if(k==obj[j].checkid())
- {
- int pas;
- cout<<"Your password:"<<endl;
- cin>>pas;
- if(pas==obj[j].ckpass())
- {
- flag=1;
- serial=j;
- }
- }
- }
- if(flag==0)
- {
- cout<<endl<<endl<<"Information does not valid"<<endl;
- }
- else
- {
- cout<<endl<<endl<<"...........Next option..........."<<endl;
- cout<<"1.Deposit"<<endl;
- cout<<"2.Withdraw"<<endl;
- cout<<"3.Balance transfer"<<endl;
- cout<<"4.Check Balance"<<endl;
- cout<<"5.Account info"<<endl;
- cout<<"6.Update info"<<endl;
- cout<<" Main menu "<<endl;
- int op;
- cin>>op;
- }
- //obj[i].show();
- // obj[i].cheack_balance();
- }
- else
- {
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement