Computer Science, asked by roger123, 1 year ago

Write a C++ program to create class named Account to perform basic operations like display balance, cash withdrawal and cash deposit of a bank account. Derive Saving_ Account class from Account class and override the methods of Account class as per need Make necessary assumptions wherever required.

Answers

Answered by Raghav1330
2

Answer:

Explanation:

For this we will be publicly inherit child class savingsAccount and the member function or the methods will be made public thus enabling all the methods to being public from outside of the class.

class Account

{

private:

char customer Id;

int balance;

public:

int check_balance();

int deposit();

int withdraw();

}

class savingsAccount :: public Account

{

public:

int deposit(int cash amt, int curr_bal);

int deposit (int curr_bal);

int withdraw(int new_bal) ;

int withdraw(int curr_bal) ;

}

In the child class the deposit and withdraw function's task is just to add or deduct the amount of cash to be withdrawn or deposited. The required arguments will be called whenever it will be needed accordingly from outside the class.

Similar questions