Posts

Showing posts from July 8, 2018

C++ Program For Banking System Using Class | C++ Programming

C++ Program For Banking System Using Class #include <iostream> using namespace std ; #include <iomanip> class bank {     char name [ 20 ];     int acno ;     char actype [ 20 ];     int bal ; public:     void opbal ( void );     void deposit ( void );     void withdraw ( void );     void display ( void ); }; void bank :: opbal ( void ) {     cout << endl          << endl;     cout << "Enter Name :-" ;     cin >> name ;     cout << "Enter A/c no. :-" ;     cin >> acno ;     cout << "Enter A/c Type :-" ;     cin >> actype ;     cout << "Enter Opening Balance:-" ;     cin >> bal ; } void bank :: deposit ( void ) {     cout << "Enter Deposit amount :-" ;     int deposit = 0 ;     cin >> deposit ;     cout << " \n Deposit Balance = " << bal + deposit ; } void bank :: withdraw ( void ) {     int withdraw ;     c

C++ Program for Constructor Overloading | C++ Programming

Constructor Overloading When more than one constructor function is defined in a class, then it is called constructor overloading or the use of multiple  constructors  in a class. It is used to increase the flexibility of a class by having a greater number of constructors for a single class. Overloading constructors in C++ programming gives us more than one way to initialize objects in a class.