Hi,
I am trying to make a bank application that has two interfaces.One is the employee interface that lets employees to create an account and assign a IDnumber to each account(lets say the bank only accepts 100 accounts) and a balance for each account.
The employee can also close an account in the employee interface by entering the IDnumber.
Now in the clients interface the user can enter the IDnumber of an account and after searching the IDnumbers created by the employees it lets the user the deposit,withdraw or show the account information such as balance.
I am not sure how i can store the IDnumbers in an array and then use them for each operation.I am also wondering how I can make use of "typedef" in my code.
Here is my code.I would appriciate it if you help me with it. Thanks in advance.
Users creating account number themselves is not a good approach. you must avoid it. Well you can add following in Customer class:
private:
static int IDs[100]; //to store IDs of employees of type int
static int employee_count; //to keep track how many have opened account
Usingstatic keyword, only one copy of both will exist for all customer objects.And then to access an ID randomly, like you want to see ID of 3rd employee then in a member function you can write:
int emp_num;
cout<<"enter employee number: ";
cin>>emp_num;
cout<<arr[emp_num];
i hope this helps. And why do you want to usetypedef? i think so that its used very lessly in c++
I don't really need employee number,I need clients ID numbers created get saved in an array and when a user wants to deposit then he or she needs to enter a valid ID number which exist in the array and deposit money to the account.