Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //write a C++ programe..
- #include<iostream.h>
- #include<conio.h>
- #include<string.h>
- class bank
- {
- int accno;
- char name[50],typeacc[10];
- float amount,balance;
- public:
- bank()
- {
- accno = 0;
- amount = 0.0;
- balance = 0.0;
- strcpy(name,"10");
- strcpy(typeacc,"10");
- }
- void read()
- {
- cout<<"Enter Acc No:";
- cin>>accno;
- cout<<"Enter Name:";
- cin>>name;
- cout<<"Enter Account Type( Saving, Current , F.D):";
- cin>>typeacc;
- cout<<"Enter Basic Balance:";
- cin>>balance;
- }
- void deposit()
- {
- cout<<"Enter the Amount to deposit:";
- cin>>amount;
- balance = balance+amount;
- }
- void withdraw()
- {
- cout<<"Enter the Amount to Withdraw:";
- cin>>amount;
- if(amount<=balance)
- balance=balance-amount;
- else
- cout<<"Not Enough Balance to Withdraw";
- }
- void print()
- {
- cout<<"\n The Account No is:"<<accno;
- cout<<"\n The Account Type is:"<<typeacc;
- cout<<"\n The Account Name is:"<<name;
- cout<<"\n The Account Balance is:"<<balance;
- }
- };
- void main()
- {
- clrscr();
- bank b;
- b.read();
- b.deposit();
- b.withdraw();
- b.print();
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement