I need a little help on this to make changes.This is the code,
Code: Select all
/*devoloping system in account transactions
g-sparkz*/
#include<iostream>
using namespace std;
int main(){
int B,W,D,T; //B=Balance,W=Withdraw,D=Deposit,T=Transaction
char x;
B=10000; //Starting Balance is 10000
T=1;
while(1){
cout<<endl<<"Transaction Number "<<T<<endl<<endl;
cout<<"Your Balance is Rs."<<B<<endl<<endl;
cout<<"Withdraw money press W"<<endl<<"Deposit money press D"<<endl<<endl;
cin>>x;
if(x=='d'){
cout<<endl<<"Enter the amount you wanna Deposit - Rs.";
cin>>D;
B=B+D;
cout<<"Your New Balnace is Rs."<<B<<endl<<endl;
}
else if(x=='w'){
cout<<endl<<"Enter the amount you wanna Withdraw - Rs.";
cin>>W;
if(W>B){
cout<<"Your Balance is Not enouf to withdraw"<<W<<endl;
}
B=B-W;
cout<<"Your New Balnace is Rs."<<B<<endl<<endl;
}
T++;
}
system("pause");
return 1;
}
Do I have to learn DATA BASE with C++ to develop this code to add some more account numbers to this?!!
I can use some loops to add account numbers to here 5 or more.But It will make my code bigger & bigger.It will cause many errors & hard to handle.So If you can suggest me any good way I will try to learn it
Thanks.
G-sparkz