Nov 17, 2010 at 11:11pm UTC
Hi building a program for college, kinda stuck at the first hurdle!!
Im including my classes i have made in the main prog but it keeps saying this
warning C4627: '#include "Manager.h"': skipped when looking for precompiled header use
1> Add directive to 'stdafx.h' or rebuild precompiled header
Not sure what it means?? I took out stdafx.h but did not help not sure where im going wrong!!
Any help is appreciated!
Brendan
Nov 17, 2010 at 11:26pm UTC
You created your project incorrectly. Go make a new project and use "Use Empty Project" to start.
Nov 17, 2010 at 11:51pm UTC
Without code, I can't help any more then the compiler can.
Nov 17, 2010 at 11:56pm UTC
Hi bud ill post my code hope u can help!!
#pragma once
#include <iostream>
using namespace std;
class Manager:public Employee
{
private:
double bonus;
double final_pay;
int hours_worked;
int hourly_rate;
public:
Manager():Employee(){};
void get_bonus();
virtual double calc_payment() = 0;
};
void Manager::get_bonus()
{
cout << " Enter Bonus in £'s ";
cin >> bonus;
}
inline double Manager::calc_payment()
{
return final_pay = (hours_worked * hourly_rate) + bonus;
}
#include "Manager.h"
#include "Employee.h"
#include <iostream>
//using namespace std;
int main()
{
Manager m1;
m1.get_emp_details();
m1.show_details();
return 0;
}
#include <iostream>
using namespace std;
class Employee
{
private:
char* Plname;
char* Pfname;
int hours_worked;
int hourly_rate;
double final_pay;
public:
Employee()
{
Plname = NULL;
Plname = new char;
Pfname = NULL;
Pfname = new char;
hours_worked = 0;
hourly_rate = 0;
final_pay = 0;
void get_emp_details(char *&Plname, char *&Pfname);
virtual double calc_payment() = 0;
void show_details(char *Plname, char *Pfname);
};
void Employee::get_emp_details(char *&Pln, char *&Pfn)
{
cout << " Enter Surname ";
cin >>*Pln;
cout << " Enter First Name ";
cin >>*Pfn;
do
{
cout << " Enter hours Worked ? ";
cin >>hours_worked;
}
while (hourly_rate <0 || hourly_rate >40);
cout << " Enter Hourly Rate ? ";
cin >>hourly_rate;
}
void Employee::show_details(char *Pln, char *Pfn)
{
cout << " Your final Salay is " << final_pay << " Based on " << hours_worked " Worked " <<endl;
}
Nov 18, 2010 at 12:27am UTC
Caan anyone pls see if they can identify something wrong with this code!!
Nov 18, 2010 at 3:07am UTC
You're missing a '}' at the end of your constructor definition.
Nov 18, 2010 at 9:14am UTC
Hi firedraco. I sorted the brace out it's telling me that the employee class is not defined and it's not the base class. Did yourun the code ?? Lol this is doin Ma nut in lol. Bring back vb lol
Again thanks!!