title: base class initialization error, no matching constructor
body: <p>First and foremost I'd like to apologize for the magnitude of code I'm dumping. I'm writing some code that allows the user to withdraw and deposit money into an account, the code also calculates the interest rate of the account and the number of withdrawals and deposits etc. I get on error when I try to call the base class functions to the child functions, &quot;no matching constructor.&quot; I can't seem to find a problem with the constructors on my own. Can anyone help?</p>
  <p>Account.cpp</p>
  <pre><code>#include &quot;Account.h&quot;
  #include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  using namespace std;
  
  
  //overloaded constructor
  Account::Account(double accBal, double annIntRate){
    accBal = accBal;
    annIntRate = annIntRate;
  };
  
  //deposit base class function
  int Account::deposit(double accBal, int numWithdrawal)
  {
    cout &lt;&lt; &quot;Enter deposit: &quot;&lt;&lt; endl;
    double depos;
    cin &gt;&gt; depos;
    accBal += depos;
    numDepos ++;
    return accBal;
  }
  
  //withdraw base class function
  void Account::withdraw(double accBal, int numWithdrawal)
  {
    double amount; 
    cin &gt;&gt; amount;
    accBal -= amount;
    numWithdrawal ++; 
  }
  
  //interest rate calculation
  void Account::calcInt(double accBal, double annIntRate)
  {
    double monthlyIntRate = annIntRate/2;
    double monthlyInt = accBal * monthlyIntRate;
    accBal += monthlyInt;
  
  }
  </code></pre>
  <p>Account.h</p>
  <pre><code>    #ifndef ACCOUNT_H
  #define ACCOUNT_H
  
  class Account
  {
    //variable declarations
    private:
    
    int accNum;
    double accBal;
    int numWithdrawal;
    int numDepos;
    double annIntRate;
    double monthServCharg;
    
    public:
  
    Account(double, double); //overloaded constructor
    
    virtual int deposit(double, int); //base class deposit declaration 
    
    virtual void withdraw(double, int); //base class withdraw declaration
    
    virtual void calcInt(double, double); //updates interest rate
    
    void setAccNum(int); //setter
    int getAccNum(){return accNum;} //getter
  
    void setAccBal(double);//setter
    double getAccBal(){return accBal;}//getter
  
    void setNumWithdrawal(int);//setter
    int getNumWithdrawal(){return numWithdrawal;}//getter
  
    void setNumDep(int);//setter
    int getNumDep(){return numDepos;}//getter
  
    void setAnnIntRate(double);//setter
    double getAnnIntRate(){return annIntRate;}//getter
  
    void setMonthServCharg(double); //setter
    double getMonthServCharg(){return monthServCharg;}//getter
  };
  #endif
  </code></pre>
  <p>SavingsAccount.cpp</p>
  <pre><code>#include &quot;SavingsAcc.h&quot;
  #include &quot;Account.h&quot;
  #include &lt;iostream&gt;
  using namespace std;
  
  //status constructor
  SavingsAccount::SavingsAccount(bool status)
  {
    status = false;
  }
  
  //deposit money function
  void SavingsAccount::deposit(bool status, double accBal, int numDepos) 
  {
    Account obj;
    obj.deposit(accBal);   //PROBLEM
  
    if (accBal &gt; 25.00)
    status = true;
    else 
    status = false;
  }
  
  //withdraw money child function, updates account status, service charges, interest rate etc
  void SavingsAccount::withdraw(double accBal, int numWithdrawal, double annIntRate, double monthServCharg) 
  {
    double amount;
    if (accBal &lt;= 25.00)
    cout &lt;&lt; &quot;Balance too low, withdrawals cannot be made at this time&quot;&lt;&lt;endl;
    else
    {
      do
      { 
        Account obj;
        obj.withdraw(numWithdrawal); // PROBLEM
        
        if (numWithdrawal &gt; 4)
        monthServCharg += 1;
  
        if (accBal &lt; 25.00)
        {annIntRate += 0.01;}
      }
      while (amount &gt; accBal);
      cout &lt;&lt; &quot;Insufficient funds!&quot;;
    }
     
  }
  
  //outputs the report of account 
  void SavingsAccount::accountReport(int accNum, bool status, int numWithdrawal, int numDepos, double monthServeCharg, double accBal)
  {
    
    cout &lt;&lt; &quot;====ACCOUNT STATUS====&quot;&lt;&lt;endl;
    cout &lt;&lt; &quot;Account number: &quot;&lt;&lt; accNum &lt;&lt;endl;
    
    if (status == true) //status 
    cout &lt;&lt; &quot;Satus: Active&quot; &lt;&lt; endl;
    else 
    cout &lt;&lt;&quot;Status: Inactive&quot; &lt;&lt; endl;
  
    cout &lt;&lt; &quot;Total deposits: &quot;&lt;&lt; numDepos &lt;&lt; endl;
    cout &lt;&lt; &quot;Total withdrawals&quot; &lt;&lt; numWithdrawal &lt;&lt; endl;
    cout &lt;&lt; &quot;Service charges: &quot;&lt;&lt; monthServeCharg &lt;&lt; endl;
    cout &lt;&lt; &quot;Balance: &quot;&lt;&lt;accBal&lt;&lt;endl;
  
  }
  </code></pre>
  <p>SavingsAccount.h</p>
  <pre><code>#ifndef SAVINGSACC_H
  #define SAVINGSACC_H
  #include &lt;iostream&gt;
  
  class SavingsAccount: public Account
  {
    private:
     
      bool status; //status variable
    
    public:
  
    SavingsAccount(bool); // constuctor
    
    void deposit(bool, double, int); // deposit function
    
    void withdraw(double, int, double, double); //withdraw function
  
    void accountReport(int, bool, int, int, double, double ); // full report of account
  };
  #endif
  </code></pre>