Hi,
I am trying to incorporate a struct and class in the same program to calculate overtime pay and hours for one person. I am having a hard time with these two and especially putting them together. I am not sure what to do to get the program to compile and get the output I want. Please help.
// Overtime Pay Structures.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
//Definition of a struct to represent overtime pay calculator
struct overtime
{
char Name[80];
int Hours;
int Wage;
};
class OTpay
{
public:
double m_hours;
double m_wage;
double m_name;
};
OTpay::OTpay()
int _tmain(int argc, _TCHAR* argv[])
{
OTpay person1;
double otXpay = 0.00;
double otHours = 0.0;
person1.m_hours = 42.0;
person1.m_name = ("Dan");
person1.m_wage = 21.55;
//Calcualte overtime pay and hours for person1
otXpay = m_wage-1.5;
otHours = m_hours+40;
cout<<endl
<<"Person 1 Name is: " <<person1.m_name;
cout<<endl
<<"Person 1 Overtime Hours are: " <<otHours;
cout<<endl
<<"Person 1 OVertime Pay is: " <<otPay;
cout<<endl;
return 0;
}