I'm getting an error with my class program. Does anyone know how to fix this?
#include <iostream>
using namespace std;
//class for a bank certificate of deposit:
class CDAccount
{
public:
CDAccount(double rate_fraction, double interest, double account);
CDAccount();
void get_data();
void putout();
void calculate();
private:
double balance;
double interest_rate;
int term;//months until maturity
};
CDAccount account;
int main( )
{
account.get_data();
account.calculate();
account.putout();
return 0;
}
void CDAccount::get_data()
{
cout << "Enter account balance: $";
cin >>account.balance;
cout << "Enter account interest rate: ";
cin >> account.interest_rate;
cout << "Enter the number of months until maturity\n"
<< "(must be 12 or fewer months): ";
cin >>account.term;
}
void CDAccount::calculate()
{
double rate_fraction, interest;
rate_fraction = account.interest_rate/100.0;
interest = account.balance*rate_fraction*(account.term/12.0);
account.balance = account.balance + interest;
}
void CDAccount:utout()
{
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout << "When your CD matures in "
<< account.term << " months,\n"
<< "it will have a balance of $"
<< account.balance << endl;
}
/*
--------------------Configuration: seven - Win32 Debug--------------------
Linking...
seven.obj : error LNK2001: unresolved external symbol "public: __thiscall CDAccount::CDAccount(void)" (??0CDAccount@@QAE@XZ)
Debug/seven.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
seven.exe - 2 error(s), 0 warning(s)
*/