hello ..
after i write this program there's error i don't know why ? what's the wrong thing?
#include<iostream>
using namespace std;
class Account
{
private:
int Acc_no ;
double balance;
public:
void SetAccInfo()
{
cout<< " please enter your account number\n";
cin>> Acc_no ;
cout<< " please enter your balance\n";
cin>> balance ;
}
double GetBalance()
{
return balance;
}
void ShowAcc()
{
cout<< " Your account number is ";
cout<< Acc_no ;
}
void Credit()
{
double amount1;
cout<< " please enter the value you want to add in your account\n";
cin>> amount1;
balance = balance + amount1;
}
void Debit()
{
double amount2;
cout<< " please enter the value that you want to willdrow from your account\n";
cin>> amount2;
if ( balance >= amount2 )
{
balance = balance - amount2;
else
cout<<" You debit amount exceed the account's balance\n";
}
};
int main()
{
Account S1;
S1.SetAccInfo();
S1.GetBalance();
S1.ShowAcc();
S1.Credit();
S1.Debit();
return 0;
}
thanx :)