I keep receiving these error messages:
Applicant.cpp:25:6: error: prototype for âvoid Applicant::setDeposit(char)â does not match any in class âApplicantâ
Applicant.h:12:7: error: candidate is: void Applicant::setDeposit(bool)
Applicant.cpp:29:6: error: prototype for âchar Applicant::getDeposit()â does not match any in class âApplicantâ
Applicant.h:13:7: error: candidate is: bool Applicant::getDeposit()
Applicant.cpp:71:5: error: prototype for âint Applicant::addPoints(int)â does not match any in class âApplicantâ
Applicant.h:22:7: error: candidate is: void Applicant::addPoints(int)
Applicant.cpp:107:5: error: prototype for âint Applicant::deductPoints(int)â does not match any in class âApplicantâ
Applicant.h:23:7: error: candidate is: void Applicant::deductPoints(int)
I have checked and checked my header file, but all of the names/prototypes are the same. I'm not sure why I keep getting these errors.
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//Implementation file
//Implements the class Applicant member functions
#include "Applicant.h"
/* set name and get name*/
void Applicant::setName(string firstName, string lastName)
{
name = firstName + " " + lastName;
}
string Applicant::getName()
{
return name;
}
/* set hours and get hours*/
void Applicant::setHours (int newHours)
{
hours = newHours;
}
int Applicant::getHours()
{
return hours;
}
/*set deposit and get deposit*/
void Applicant::setDeposit(bool newDeposit)
{
deposit = newDeposit;
}
bool Applicant::getDeposit()
{
if (deposit == 200)
return true;
else
return false;
}
/* Set and get payMonth*/
void Applicant::setPayMonth(int newPayMonth)
{
payMonth = newPayMonth;
}
int Applicant::getPayMonth()
{
return payMonth;
}
/* Set and get payDay*/
void Applicant::setPayDay(int newpayDay)
{
payDay = newpayDay;
}
int Applicant::getPayDay()
{
return payDay;
}
/* Set and get housing*/
void Applicant::setHousing(string newHousing)
{
housing = newHousing;
}
string Applicant::getHousing()
{
return housing;
}
/* Set and get sex*/
void Applicant::setSex(char newSex)
{
sex = newSex;
}
char Applicant::getSex()
{
return sex;
}
/* Add any necessary points to student's RSVP points*/
int Applicant::addPoints(int gpa)
{
int addpoints=0;
int crdhours=0;
if (gpa >= 3.80)
return addpoints+20;
else if (gpa >= 3.50)
return addpoints+18;
else if (gpa >= 3.20)
return addpoints+16;
else if (gpa >= 3.00)
return addpoints+14;
else if (gpa >= 2.80)
return addpoints+12;
else if (gpa >= 2.60)
return addpoints+10;
else if (gpa >= 2.40)
return addpoints+8;
else if (gpa >= 2.20)
return addpoints+6;
else if (gpa >= 2.00)
return addpoints+4;
else if (gpa >= 0.00)
return addpoints+2;
if (crdhours <= 29)
return crdhours+10;
else if (crdhours <= 59)
return crdhours+8;
else if (crdhours <= 59)
return crdhours+6;
else if (crdhours >= 90)
return crdhours+4;
points = addpoints+crdhours;
return points;
}
/* Deduct any points from student's RSVP points*/
int Applicant::deductPoints(int minuspoints)
{
points = points - minuspoints;
return points;
}
/*Get the total points for the student*/
int Applicant::getPoints()
{
return points;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//SPECIFICATION FILE
#include <string>
using namespace std;
class Applicant
{
public:
// public member functions
void setName(string, string);
string getName();
void setHours(int);
int getHours();
void setDeposit(bool);
bool getDeposit();
void setPayMonth(int);
int getPayMonth();
void setPayDay(int);
int getPayDay();
void setHousing(string);
string getHousing();
void setSex(char);
char getSex();
int addPoints(int);
int deductPoints(int);
int getPoints();
private:
//11 private data members
string name;
int hours;
int zip;
bool deposit;
int payMonth;
int payDay;
string housing;
char sex;
int points;
};