You are on page 1of 2

Account Class

============================================
#include <stdlib.h>
#include <string.h>
#include <iostream.h>

class Account{

public:

void setData(int an, char *ti, double bal)


{
acNo=an;
strcpy(title,ti);
balance=bal;
}

void deposite(int amount)


{
balance+=amount;
}

void withDraw(int amount)


{
if(amount<=balance)
balance-=amount;
else
cout<<"\nLow Credit";
}

void printData()
{
cout<<"\nAccount No - - "<<acNo;
cout<<"\nTitle - - "<<title;
cout<<"\nBalance - - "<<balance;
}
private:

int acNo;
char title[30];
double balance;

};
void main()
{
Account ac;

ac.setData(7125,"Rana",1000);
ac.deposite(4000);
ac.withDraw(2000);
system("cls");
ac.printData();

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006