7 Managing Bank Account Using Inheritance Concept

MANAGING BANK ACCOUNT USING INHERITANCE CONCEPT Program: #include #include class account { protected: char cust_name[10]; int acc_no; char acc_type[10]; public: void getdata(); void putdata(); }; void account::getdata() { coutcust_name; coutacc_no; coutacc_type; } void account :: putdata() { cout

Please download to get full document.

View again

of 5
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.

Study Guides, Notes, & Quizzes

Publish on:

Views: 0 | Pages: 5

Extension: PDF | Download: 0

  MANAGING BANK ACCOUNT USING INHERITANCE CONCEPT Program:#include<iostream.h>#include<conio.h>class account{protected:char cust_name[10];int acc_no;char acc_type[10];public:void getdata();void putdata();};void account::getdata(){cout<< Enter the customer name: ;cin>>cust_name;cout<< Enter the account Number: ;cin>>acc_no;cout<< Enter the account type: ;cin>>acc_type;}void account :: putdata(){  cout<< Customer Name: <<cust_name<< \n ;cout<< Account Number: <<acc_no<< \n ;cout<< Account type: <<acc_type<< \n ;}class saving : public account{float deposit;float balance;public:saving(){deposit=500;balance=deposit;}void s_update();void s_display();};void saving::s_update(){putdata();cout<< Enter the deposit amount: ;cin>>deposit;balance=balance+deposit;}void saving::s_display(){  putdata();cout<< Balance: <<balance<< \n ;}class current : public account{float deposit;float wd_amt;float balance;public:current(){deposit=500;balance=deposit;}void c_update();void c_display();};void current::c_update(){cout<< Enter the deposit amount: ;cin>>deposit;cout<< Enter the withdrawal amount: ;cin>>wd_amt;balance=balance+(deposit-wd_amt);}void current::c_display()  {putdata();cout<< Balance: <<balance<< \n ;}void main(){saving s[3];current c[3];int i;cout<< Enter the customer details for saving account ;for(i=0;i<3;i++){s[i].getdata();clrscr();}cout<< Enter the customer detials for the current account: ;for(i=0;i<3;i++){c[i].getdata();clrscr();}cout<< Update the values for saving account: ;for(i=0;i<3;i++){s[i].putdata();s[i].s_update();
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks