Friday, 5 July 2013

Program to write Bank Client details with CLASS in C++..

Write a program of client details of bank with the help of CLASS in C++

#include<iostream.h>
#include<conio.h>
class bank
{
    private:
        int ac,dp,wd,bal;
        char name[20];
    public:
        void read()
        {
            cout<<"\n Enter account number: ";
            cin>>ac;
            cout<<"\n Enter client name: ";
            cin>>name;
            cout<<"\n Enter Amount of Deposit: ";
            cin>>dp;
            cout<<"\n Enter Amount of Withdraw: ";
            cin>>wd;
        }
        void process()
        {
            bal=dp-wd;
        }
        void getdata()
        {
            cout<<"\n Account Number= "<<ac;
            cout<<"\n Client Name= "<<name;
            cout<<"\n Amount of Deposit= "<<dp;
            cout<<"\n Amount of Withdraw= "<<wd;
            cout<<"\n Total Balance= "<<bal;
        }
};
void main()
{
    clrscr();
    bank b;
    b.read();
    b.process();
    b.getdata();
    getch();
}

Here is the output :)

 

 

No comments:

Post a Comment