May 2012
Intermediate to advanced
679 pages
16h 56m
English
Problem: Define a class to represent bank account. Include the following members:
Data members:
Member functions:
Write a main function to test the program.
Solution: See Program 21.6.
// bank3.cpp
#include<iostream.h>
#include<string.h>
class BankAccount
{ protected :
char name[20] ;
int accNumber ;
int bal ;
public:
BankAccount(char *p,int i,int j) ;
void deposit(int sum);
int withdraw(int sum) ;
void display();
};
int main() ...
Read now
Unlock full access