Okay here's what I have so far... The error I receieve is below...
The HCP Header File
#ifndef HEALTHCAREPROVIDER_H
#define HEALTHCAREPROVIDER_H
#include "stdafx.h"
#include <string>
#include <iostream>
using namespace std;
class HealthCareProvider
{
protected:
string fullName;
string profession;
int yearsExperience;
string companyType;
string apptAvail;
double bill;
double fee;
public:
HealthCareProvider (const string &, const string &, const int &, const string &, const string &);
void setFullName (const string &);
string getFullName() const;
void setProfession (const string &);
string getProfession() const;
void setYearsExperience (const int &);
int getYearsExperience() const;
void setCompanyType(const string &);
string getCompanyType() const;
void setApptAvail(const string &);
string getApptAvail() const;
virtual double billForTreatment(...) =0;
void printInfo() const;
};
HealthCareProvider::HealthCareProvider(const string &name, const string &profess, const int &years, const string &coType, const string &appt)
: fullName(name), profession(profess), yearsExperience(years), companyType(coType), apptAvail(appt)
{
//empty
}
void HealthCareProvider::setFullName(const string &name)
{
fullName = name;
}
string HealthCareProvider::getFullName() const
{
return fullName;
}
void HealthCareProvider::setProfession(const string &profess)
{
profession = profess;
}
string HealthCareProvider::getProfession() const
{
return profession;
}
void HealthCareProvider::setYearsExperience(const int &years)
{
yearsExperience = years;
}
int HealthCareProvider::getYearsExperience() const
{
return yearsExperience;
}
void HealthCareProvider::setCompanyType(const string &coType)
{
companyType = coType;
}
string HealthCareProvider::getCompanyType() const
{
return companyType;
}
void HealthCareProvider::setApptAvail(const string &appt)
{
apptAvail = appt;
}
string HealthCareProvider::getApptAvail() const
{
return apptAvail;
}
void HealthCareProvider::printInfo() const
{
cout<<"Name: "<<getFullName()<<endl;
cout<<"Profession: "<<getProfession()<<endl;
cout<<"Years Experience: "<<getYearsExperience()<<endl;
cout<<"Liability: "<<getCompanyType()<<endl;
cout<<"Appointment Availability: "<<getApptAvail()<<endl;
cout<<"Bill for Treatment: "<<billForTreatment()<<endl;
}
#endif
The Dentist Header
#ifndef DENTIST_H
#define DENTIST_H
#include "HealthCareProvider.h"
class Dentist : public HealthCareProvider
{
public:
Dentist(const string &, const string &, const int &, const string &, const string &);
double billForTreatment(...)
{return (bill + fee);}
};
#endif
Then the HCP CPP File
// HealthCareProvider.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include "Dentist.h"
#include "HealthCareProvider.h"
int _tmain(int argc, _TCHAR* argv[])
{
HealthCareProvider *healthptr = new Dentist ("Bob", "Dentist", 5, "LLC", "Available");
healthptr->billForTreatment(100, 25);
healthptr->printInfo();
system("PAUSE");
return 0;
}
Now my Error that I am receiving...
...visual studio 2010\projects\healthcareprovider\healthcareprovider\healthcareprovider.h(109): error C2662: 'HealthCareProvider::billForTreatment' : cannot convert 'this' pointer from 'const HealthCareProvider' to 'HealthCareProvider &'
1> Conversion loses qualifiers
1>
1>Build FAILED.
I know where the error is but any alteration I made seems to cause a crap ton of more errors... any ideas? BTW this project is far from complete, but one mistake at a time.
Thanks!
~Climber