Logo 
Search:

C++ Programming Articles

Submit Article
Home » Articles » C++ Programming » BeginnersRSS Feeds

Program for Banking Application

Posted By: Easy Tutor     Category: C++ Programming     Views: 26832

Define a class to represent a bank account. Include the following members:

Data Members
1 Name of the depositor
2 Account Number
3 Type of account
4 Balance amount in the account

Member function
1 To assign initial values
2 To deposit an amount
3 To withdraw an amount after checking the balance
4 To display name and Balance

write a main program to test the program.

Code for Program for Banking Application in C++ Programming

/*www.DailyFreeCode.comDownload Projects, Sourcecodes, Tips and Tricks, Interview FAQs, Hotlinks and more....Logon to www.DailyFreeCode.com*//*Define a class to represent a bank account. Include the followingmembers:Data Members1    Name of the depositor2    Account Number3    Type of account4    Balance amount in the accountMember function1    To assign initial values2    To deposit an amount3    To withdraw an amount after checking the balance4    To display name and Balancewrite a main program to test the program.   */

#include <iostream.h>
#include <iomanip.h>
#include <conio.h>

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;
deposit=deposit+bal;
cout<<"\nDeposit Balance = "<<deposit;
bal=deposit;
}

void bank :: withdraw(void)
{
int withdraw;
cout<<"\nBalance Amount = "<<bal;
cout<<"\nEnter Withdraw Amount :-";
cin>>withdraw;
bal=bal-withdraw;
cout<<"After Withdraw Balance is "<<bal;
}

void  bank :: display(void)
{
cout<<endl<<endl<<endl;
cout<<setw(50)<<"DETAILS"<<endl;
cout<<setw(50)<<"name      "<<name<<endl;
cout<<setw(50)<<"A/c. No.     "<<acno<<endl;
cout<<setw(50)<<"A/c Type      "<<actype<<endl;
cout<<setw(50)<<"Balance     "<<bal<<endl;
}

void main()
{
clrscr();
bank o1;
int choice;
    do
    {
           cout<<"\n\nChoice List\n\n";
           cout<<"1)  To assign Initial Value\n";
         cout<<"2)  To Deposit\n";
         cout<<"3)  To Withdraw\n";
         cout<<"4)  To Display All Details\n";
         cout<<"5)  EXIT\n";
         cout<<"Enter your choice :-";
         cin>>choice;
         switch(choice)
         {
         case 1: o1.opbal();
                     break;
         case 2: o1.deposit();
                     break;
           case 3: o1.withdraw();
                     break;
         case 4: o1.display();
                     break;
            case 5: goto end;
         }
   }while(1);
end:
}
  
Share: 


Didn't find what you were looking for? Find more on Program for Banking Application Or get search suggestion and latest updates.

Easy Tutor
Easy Tutor author of Program for Banking Application is from United States. Easy Tutor says

Hello Friends,

I am Free Lance Tutor, who helped student in completing their homework.

I have 4 Years of hands on experience on helping student in completing their homework. I also guide them in doing their final year projects.

I have share many programs on this website for everyone to use freely, if you need further assistance, than please contact me on easytutor.2ya [at the rate] gmail [dot] com

I have special discount scheme for providing tutor services. I am providing tutor service to students from various contries, currently most of my students are from United States, India, Australia, Pakistan, Germany, UK and Canada.

I am also here to expand my technical network to receive more opportunity in my career, make friends to help them in resolving their technical problem, learn and share my knowledge, If you like to be my friend, Please send me friend request.

Thanks,
Happy Programming :)

 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
PARHAI MARING from India Comment on: Sep 29
I think the Programme doesn't work at Turbo C++, pops up the message as " Error Directive: Use C++ for the type iostream" , Can you solve me this....

View All Comments