Im pretty new to C++, This being my first attempt at classes, anyone know what the problem with this code it?
Code:
#include "stdafx.h"
#include <iostream.h>
typedef unsigned short int USHORT;
int main(int argc, char* argv[])
{
class Employee
{
public:
float salary;
USHORT age;
char level;
USHORT yearswithcompany;
float worth(USHORT yearswithcompany, float salary)
{
int temp = yearswithcompany * 12;
int temp = temp * salary;
return temp;
}
}
Employee Evan;
Evan.salary = 3400.23;
Evan.age = 14;
Evan.level = 'Manager'
Evan.yearswithcompany = 4;
Evan.worth(Evan.age, Evan,salary)
cout << "Evans earnings with the company total" << Evan.worth << "\n";
return 0;
}
Stupid example.