How to add an additional data member "number" to Account class?
<p>I am a little confused with syntax I guess. I am needing help on adding an addtional data member to class account called number. How would I do that?? I have tried adding an addtional data member called number that will represent an unique account number. The data meber will be used to locate the account so there will need to be a consturctor/or edit the constructors and "display" method. </p>

<p>Here is the code for Account.h:</p>

<pre><code>#define START_BALANCE 500.0
#define START_INTEREST_RATE 0.0175
// define Account class
class Account
{
private:
     double balance;
     doube interestRate;
public:
    // constructor with default values
    // set to default values if value(s) is/are not valid
    Account(double initialBalance, double initialInterestRate);
    // observers
    double getBalance() const; // return balance
    double getInterestRate() const; // return interestRate
    void displayAccountInformation() const; // display formatted account information through cout
    // transformers
    bool deposit(double amount);
    // disposit amount into account
    // return false if unsuccessful (amount invalid, balance not changed)
    //        true otherwise
    bool withdraw(double amount);
    // withdraw amount from account
    // return false if unsuccessful (amount invalid, balance not changed)
    //        true otherwise
    void applyInterest(); // apply interestRate to balance
    bool setInterestRate(double newRate);
    // change interestRate to newRate
    // return false if unsuccessful (newRate invalid, interestRate not changed)
    //        true otherwise
    bool setBalance(double newBalance);
    // change balance to newBalance
    // return false if unsuccessful (newBalance invalid, balance not changed)
    //        true otherwise

}; // end Account

#endif
</code></pre>

<p>and here is the code for Account.cpp</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include "Account.h"
#include "ListDA.h"
using namespace std;

// constructor with default values
// set to default values if value(s) is/are not valid
Account::Account(double initialBalance = START_BALANCE, double initialInterestRate = START_INTEREST_RATE)
{
    if (initialBalance &gt;= 0)
        balance = initialBalance;
    else // initialBalance &lt; 0
        balance = START_BALANCE;
    if (initialInterestRate &gt;= 0 &amp;&amp; initialInterestRate &lt; 1)
        interestRate = initialInterestRate;
    else // initialInterestRate &gt;= 1 or initialInterestRate &lt; 0
        interestRate = START_INTEREST_RATE;
} // end Account

// observers
double Account::getBalance() const
// return balance
{
    return balance;
} // end getBalance

double Account::getInterestRate() const
// return interestRate
{
    return interestRate;
} // end getInterestRate

void Account::displayAccountInformation() const
// display formatted account information through cout
{
    cout &lt;&lt; "Account Information" &lt;&lt; endl
         &lt;&lt; "Current Balance: $" &lt;&lt; fixed &lt;&lt; setprecision(2) &lt;&lt; balance &lt;&lt; endl
         &lt;&lt; "Interest Rate: " &lt;&lt; interestRate * 100 &lt;&lt; "%" &lt;&lt; endl;
} // end displayAccountInformation

// transformers
bool Account::deposit(double amount)
// disposit amount into account
// return false if unsuccessful (amount invalid, balance not changed)
//        true otherwise
{
    if (amount &lt; 0) // invalid amount
        return false;
    balance += amount;
    return true;
} // end deposit

bool Account::withdraw(double amount)
// withdraw amount from account
// return false if unsuccessful (amount invalid, balance not changed)
//        true otherwise
{
    if (amount &lt; 0 || amount &gt; balance) // invalid amount
        return false;
    balance -= amount;
    return true;
} // end withdraw

void Account::applyInterest()
// apply interestRate to balance
{
    balance *= 1.0 + interestRate;
} // end applyInterest

bool Account::setInterestRate(double newRate)
// change interestRate to newRate
// return false if unsuccessful (newRate invalid, interestRate not changed)
//        true otherwise
{
    if (newRate &lt; 0 || newRate &gt;= 1) // invalid newRate
        return false;
    interestRate = newRate;
    return true;
} // end setInterestRate

bool Account::setBalance(double newBalance)
// change balance to newBalance
// return false if unsuccessful (newBalance invalid, balance not changed)
//        true otherwise
{
    if (newBalance &lt; 0) // invalid balance
        return false;
    balance = newBalance;
    return true;

} // end setBalance
</code></pre>

<p>Any advise helpful. Thanks.</p>
