I have attached my header and cpp files. I have the problem as listed in the subject line and would very much appreciate some guidance. I have enclosed the problem line in ****. Thank you so much.
#ifndef POPULATION_H
#define POPULATION_H
#include <iostream>
#include <iomanip>
usingnamespace std;
class Population
{
private:
double birthRate() const; // don't need thesedouble deathRate() const;
public:
int births; // these should be privateint deaths;
int pop;
Population(int pop, int births, int deaths);
int setBirths() //const
{
return births;}
int setDeaths()
{
return deaths;}
int setPop()
{
return pop;}
int getBirths() //const // use const on gets, not sets
{
return births;}
int getDeaths()
{
return deaths;}
int getPop()
{
return pop;}
double getBirthRate() const
{ return pop/births;} // this is doing integral division, cast births to a double to get a floating-point resultdouble getDeathRate() const
{return (pop/deaths);} // this too
};
#endif
//Implementation file for Population class
#include "population.h"
#include <iostream>
#include <iomanip>
usingnamespace std;
//population.h 09/20/11
//Population::Population(int p, int b, int d) // this constructor needs definedint main()
{
Population testPop(); // the compiler thinks this is a forward declaration because of empty ()'s,
// pass 3 arguments like the constructor above - note, this also needs moved down
// past the cins...to get the values into the classint births;
int deaths;
int pop;
//Get the population
cout << "Enter the population: ";
cin >> pop;
cout << "Enter the number of births: ";
cin >> births;
cout << "Enter the number of deaths: ";
cin >> deaths;
//*******************************************************************
cout << "The birth rate is: " << [testPop.getbirthRate << endl; // see my first post
//**********************************************************************
system("pause");
return 0;
}