I cannot figure out why I am getting this error...error C2228: left of '.getWithdrawl
Code:
#include <iostream>
#include <cmath>
using namespace std;
class Account
{
public:
// The account number is
int id;
// The account balance is
double Accountbalance;
// The current interest rate is
double annualInterestRate;
// Construct default account
Account()
{
id = 0;
Accountbalance = 0;
annualInterestRate = 0;
}
// Accessor function
int getid();
double getAccountbalance();
double getannualInterestRate();
// Mutator function
void setid(int);
void setAccountbalance(double);
void setannualInterestRate(double);
// Interest Rate function
double getMonthlyInterestRate()
{
return annualInterestRate / 12;
}
// Withdrawl function
double getWithdrawl()
{
return Accountbalance - 2500;
}
// Deposit function
double getDeposit()
{
return Accountbalance + 3000;
}
};
int main ()
{
int Accountid(1122);
double Accountbalance(20000);
double AnnualInterestRate(0.045);
cout << "The account id is " << Accountid << "and the begining account balance is " << Accountbalance << endl;
cout << "The balance after the withdrawl is " << Accountbalance.getWithdrawl() << endl;
cout << "The balance after the deposit is " << Accountbalance.getDeposit() << endl;
cout << "The monthly interest rate is " << AnnualInterestRate.getMonthlyInterestRate() << endl;
cout << "This account was created on 3 April 2012." << endl;
system "pause";
return 0;
}
Comment