so I have to write this c++ program that gets 2 employees information (including name, personnel id, and salary) and after comparing them, it will show the employee's name with the most salary. instead of the easy way, I should use class to write this. here is my code:
#include <iostream>
#include <conio.h>
using namespace std;
class employee{
char emp_name[20];
int emp_id;
float emp_sal;
public:
void input()
{
cout << "Enter Employee's Name: ";
cin >> emp_name;
cout << "\nEnter Personnel ID: ";
cin >> emp_id;
cout << "\nEnter Salary: ";
cin >> emp_sal;
}
void most_sal(){
int max = 0;
if (emp_sal > max){
cout << emp_name;
}
}
};
int main (){
employee e1,e2;
e1.input();
e2.input();
e1.most_sal();
e2.most_sal();
}
I know that the most_sal part in void most_sal() is not correct but I don't know what I should write instead.