Develop a C++ programs on BANKING SYSTEM have Customer class with name, address and phoneno. Create derived class account class with data members like account number, name, deposit, withdraw amount and type of account. A customer can deposit and withdraw amount in his account. Develop a C++ program to display the details of a customer and the remaining balance amount. [Note: Use virtual function]
#include <iostream>
using namespace std;
//define class Customer
class Customer{
public:
string name;
string address;
string phoneNo;
virtual void displayInfo(){
cout<<"Display customers information"<<endl;
}
virtual void mybalance(){
cout<<"Display customers balance"<<endl;
}
};
//define class Account
class Account: public Customer{
private:
string account_no;
string accout_name;
double deposit_amount;
double withdraw_amount;
double balance;
public:
void displayInfo(){
cout<<"Name"<<name<<endl;
cout<<"Address"<<address<<endl;
cout<<"Phone number"<<phoneNo<<endl;
}
void myBalance(){
cout<<"Balance:"<<balance<<endl;
}
};
int main(){
Account a;
a.displayInfo();
a.myBalance();
return 0;
}
Comments
Leave a comment